summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--itjs.class2
-rw-r--r--itjs.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/itjs.class b/itjs.class
index edc0d33..c0a8ef3 100644
--- a/itjs.class
+++ b/itjs.class
@@ -72,7 +72,7 @@ function encode($values)
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;
+ $result .= $quote . preg_replace('/([\xa0-\xff])/e', 'sprintf("\\x%02x", ord("\\1"))', strtr($value, array("\0" => '\\0', '"' => '\\"', "</"=>"<\\/", "\n" => '\\n', "\r" => '\\r', "\t" => '\\t', "\\" => '\\\\'))) . $quote;
}
else
$result .= itjs::encode($value);
diff --git a/itjs.php b/itjs.php
index 5c23b4a..d8932ed 100644
--- a/itjs.php
+++ b/itjs.php
@@ -43,7 +43,7 @@ if ($checksum != $_SERVER['HTTP_IF_NONE_MATCH'])
header("Cache-Control: max-age=900");
if ($_REQUEST['boot'])
- $data = preg_replace('/([\xa0-\xff])/e', 'sprintf("\\u%04x", ord("\\1"))', $data) . "window.it_boot_init();";
+ $data .= "window.it_boot_init();";
echo itjs::strip($data);
}