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_html.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it_html.class') diff --git a/it_html.class b/it_html.class index 0951e6b..68ca04a 100644 --- a/it_html.class +++ b/it_html.class @@ -455,8 +455,8 @@ function sanitize($html) function entity_decode($string) { $string = preg_replace('/&#(8217|65533);/', "'", html_entity_decode($string)); - $string = preg_replace('/�*([0-9a-f]+);/ei', 'hexdec("\\1") <= 255 ? chr(hexdec("\\1")) : " "', $string); - $string = preg_replace('/�*([0-9]+);/e', '\\1 <= 255 ? chr(\\1) : " "', $string); + $string = preg_replace_callback('/�*([0-9a-f]+);/i', function($m) { return hexdec($m[1]) <= 255 ? chr(hexdec($m[1])) : " "; }, $string); + $string = preg_replace_callback('/�*([0-9]+);/', function($m) { return $m[1] <= 255 ? chr($m[1]) : " "; }, $string); return $string; } -- cgit v1.2.3