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 --- it_xml.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it_xml.class') diff --git a/it_xml.class b/it_xml.class index 2401b7b..4e34c81 100644 --- a/it_xml.class +++ b/it_xml.class @@ -131,7 +131,7 @@ function _sanitize($xmldata, $isutf8 = null) # If should be utf-8 and can't be decoded as such, fix it, even if mixed between both if ($isutf8 && preg_match('/[^\x80-\xff][\x80-\xff][^\x80-\xff]/', $xmldata)) - $xmldata = preg_replace('/[\x80-\xff]{1,4}/e', "it_xml::_utf8_fix('\\0')", $xmldata); + $xmldata = preg_replace_callback('/[\x80-\xff]{1,4}/', function($m) { return it_xml::_utf8_fix($m[0]); }, $xmldata); # If not utf-8, remove characters illegal for latin-1 if (!$isutf8 && preg_match('/[\x00-\x08\x0b-\x0c\x0e-\x1f\x80-\x9f]/', $xmldata)) -- cgit v1.2.3