* Fix bug .

This commit is contained in:
tanghucheng
2022-06-28 10:47:25 +08:00
parent 921f8a0950
commit 0a9f2056ee
+5 -5
View File
@@ -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';