diff options
Diffstat (limited to 'itjs.class')
-rw-r--r-- | itjs.class | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -89,7 +89,8 @@ function encode($values) $result .= 'false'; else if (!is_array($value)) { - $quote = (strval(intval($value)) === strval($value)) ? "" : '"'; + $value = strval($value); + $quote = (strval(intval($value)) === $value) ? "" : '"'; $string = strtr($value, array("\0" => '\\0', '"' => '\\"', "</"=>"<\\/", "\n" => '\\n', "\r" => '\\r', "\t" => '\\t', "\\" => '\\\\')); $string = $GLOBALS['itjs_defaultconfig']['latin2unicode'] ? preg_replace('/([\xa0-\xff])/e', 'sprintf("\\u%04x", ord("\\1"))', $string) : $string; $result .= $quote . $string . $quote; |