diff options
author | Christian Schneider | 2012-02-13 14:46:59 +0000 |
---|---|---|
committer | Christian Schneider | 2012-02-13 14:46:59 +0000 |
commit | ca407bc3f8e3e6d5f042be787f96304687af097e (patch) | |
tree | 52b8dd84fd1037e92171917f5dbdb95f51e5b237 /itjs.class | |
parent | 3207842eeab9de8c558d23506ecc38cbe1ad8035 (diff) | |
download | itools-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.class | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |