From: Petr Skoda Date: Wed, 2 Dec 2009 21:08:45 +0000 (+0000) Subject: MDL-21026 improved entity handling X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7e4763ef6177b20923dc7a31fd2e353a3c098983;p=moodle.git MDL-21026 improved entity handling --- diff --git a/lib/weblib.php b/lib/weblib.php index 37c148f505..d175fcc6d7 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1149,8 +1149,8 @@ function wikify_links($string) { * @return string */ function fix_non_standard_entities($string) { - $text = preg_replace('/(&#[0-9]+)(;?)/', '$1;', $string); - $text = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', '$1;', $text); + $text = preg_replace('/�*([0-9]+);?/', '&#$1;', $string); + $text = preg_replace('/�*([0-9a-fA-F]+);?/', '&#x$1;', $text); return $text; }