summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--itjs.class6
1 files changed, 5 insertions, 1 deletions
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;