summaryrefslogtreecommitdiff
path: root/itjs.class
diff options
context:
space:
mode:
authorChristian Schneider2012-02-13 14:46:59 +0000
committerChristian Schneider2012-02-13 14:46:59 +0000
commitca407bc3f8e3e6d5f042be787f96304687af097e (patch)
tree52b8dd84fd1037e92171917f5dbdb95f51e5b237 /itjs.class
parent3207842eeab9de8c558d23506ecc38cbe1ad8035 (diff)
downloaditools-ca407bc3f8e3e6d5f042be787f96304687af097e.tar.gz
itools-ca407bc3f8e3e6d5f042be787f96304687af097e.tar.bz2
itools-ca407bc3f8e3e6d5f042be787f96304687af097e.zip
Replace preg_replace /e modifier with preg_replace_callback: Modified planned to be removed. ITools now requires PHP 5.3 or newer
Diffstat (limited to 'itjs.class')
-rw-r--r--itjs.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/itjs.class b/itjs.class
index 91ebd74..a7a6a15 100644
--- a/itjs.class
+++ b/itjs.class
@@ -92,7 +92,7 @@ function encode($values)
{
$quote = (strval(intval($value)) === strval($value)) ? "" : '"';
$string = strtr($value, array("\0" => '\\0', "\x84" => '\\"', "\x93" => '\\"',"\x94" => '\\"', '"' => '\\"', "</"=>"<\\/", "\n" => '\\n', "\r" => '\\r', "\t" => '\\t', "\\" => '\\\\'));
- $string = $GLOBALS['itjs_defaultconfig']['latin2unicode'] ? preg_replace('/([\xa0-\xff])/e', 'sprintf("\\u%04x", ord("\\1"))', $string) : $string;
+ $string = $GLOBALS['itjs_defaultconfig']['latin2unicode'] ? preg_replace_callback('/([\xa0-\xff])/', function($m) { return sprintf("\\u%04x", ord($m[1])); }, $string) : $string;
$result .= $quote . $string . $quote;
}
else