From 8f988e6449488f2c58f9589399a582804c52d31f Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 29 Jun 2012 10:02:29 +0000 Subject: numeric entities already handled (except for illegals, remove those) --- it_html.class | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'it_html.class') diff --git a/it_html.class b/it_html.class index ece7070..bf9f8ff 100644 --- a/it_html.class +++ b/it_html.class @@ -459,8 +459,7 @@ function sanitize($html) function entity_decode($string) { $string = preg_replace('/&#(8217|65533);/', "'", html_entity_decode($string, ENT_COMPAT, $GLOBALS['it_html']->p['charset'])); - $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); + $string = preg_replace('/&#[^;]*;/i', " ", $string); # remove remaining illegal numeric entities, e.g. 0x80-0x9f return $string; } -- cgit v1.2.3