summaryrefslogtreecommitdiff
path: root/it_html.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 /it_html.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 'it_html.class')
-rw-r--r--it_html.class4
1 files changed, 2 insertions, 2 deletions
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('/&#x0*([0-9a-f]+);/ei', 'hexdec("\\1") <= 255 ? chr(hexdec("\\1")) : " "', $string);
- $string = preg_replace('/&#0*([0-9]+);/e', '\\1 <= 255 ? chr(\\1) : " "', $string);
+ $string = preg_replace_callback('/&#x0*([0-9a-f]+);/i', function($m) { return hexdec($m[1]) <= 255 ? chr(hexdec($m[1])) : " "; }, $string);
+ $string = preg_replace_callback('/&#0*([0-9]+);/', function($m) { return $m[1] <= 255 ? chr($m[1]) : " "; }, $string);
return $string;
}