From f43af745e8c07b72ea9453163438d8ddce753841 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Tue, 8 May 2007 14:05:31 +0000 Subject: encode() correctly encodes boolean values --- itjs.class | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/itjs.class b/itjs.class index e49f98f..c7ab607 100644 --- a/itjs.class +++ b/itjs.class @@ -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; -- cgit v1.2.3