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 /it_html.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 'it_html.class')
-rw-r--r-- | it_html.class | 4 |
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('/�*([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; } |