summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
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;
}