From 0a9f2056eee6f3aa6908b72e088ac589c2e0acb9 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 28 Jun 2022 10:47:25 +0800 Subject: [PATCH] * Fix bug . --- lib/base/front/front.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 1caa64a417..4c18838dfb 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -1225,7 +1225,11 @@ EOT; } /* Fix value is '0123' error. */ - if(is_array($value) or is_object($value) or is_string($value)) + if(is_numeric($value) and !preg_match('/^0[1-9]/', $value)) + { + $js .= "{$prefix}{$key} = {$value};"; + } + elseif(is_array($value) or is_object($value) or is_string($value)) { /* Fix for auto-complete when user is number.*/ if(is_array($value) or is_object($value)) @@ -1240,10 +1244,6 @@ EOT; $value = json_encode($value); $js .= "{$prefix}{$key} = {$value};"; } - elseif(is_numeric($value)) - { - $js .= "{$prefix}{$key} = {$value};"; - } elseif(is_bool($value)) { $value = $value ? 'true' : 'false';