diff options
-rw-r--r-- | itjs.class | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -65,7 +65,11 @@ function encode($values) $result .= "$key:"; } - if (!is_array($value)) + if ($value === true) + $result .= 'true'; + else if ($value === false) + $result .= 'false'; + else if (!is_array($value)) { $quote = (strval(intval($value)) === strval($value)) ? "" : '"'; $result .= $quote . strtr($value, array("\0" => '\\0', '"' => '\\"', "</"=>"<\\/", "\n" => '\\n', "\r" => '\\r', "\t" => '\\t', "\\" => '\\\\')) . $quote; |