From 0cfed6ba111bbe678dfab5316c46800f231adf21 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 12 Apr 2012 22:04:51 +0000 Subject: [PATCH] Allow 2 digits with leading 0 when increment >= 10 --- etemplate/inc/class.select_widget.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etemplate/inc/class.select_widget.inc.php b/etemplate/inc/class.select_widget.inc.php index 407a5560cd..493cb92b37 100644 --- a/etemplate/inc/class.select_widget.inc.php +++ b/etemplate/inc/class.select_widget.inc.php @@ -403,7 +403,7 @@ class select_widget $format = '%d'; if (!empty($type3) && $type3[0] == '0') // leading zero { - $format = '%0'.strlen($type3).'d'; + $format = '%0'.(intval($type3) < 10 ? strlen($type3): strlen($type3) - 1).'d'; } $type3 = !$type3 ? 1 : intval($type3); // decrement if (($type <= $type2) != ($type3 > 0))