From 7e4763ef6177b20923dc7a31fd2e353a3c098983 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 2 Dec 2009 21:08:45 +0000 Subject: [PATCH] MDL-21026 improved entity handling --- lib/weblib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.5