From 2ef85ec182278544ed7a625a319b8b0ee4edbc74 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Fri, 7 Nov 2008 15:33:07 +0000 Subject: First version of it_html based on objects --- itjs.class | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'itjs.class') diff --git a/itjs.class b/itjs.class index 40d65b8..bafc103 100644 --- a/itjs.class +++ b/itjs.class @@ -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; -- cgit v1.2.3