From ca407bc3f8e3e6d5f042be787f96304687af097e Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 13 Feb 2012 14:46:59 +0000 Subject: Replace preg_replace /e modifier with preg_replace_callback: Modified planned to be removed. ITools now requires PHP 5.3 or newer --- itjs.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'itjs.class') 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 -- cgit v1.2.3