From 72f8b520a148d4961605b784b2d470793aa06e67 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 2 Dec 2009 21:14:02 +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 f82d9cee7b9..1bcb922f439 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1670,8 +1670,8 @@ function clean_text($text, $format=FORMAT_MOODLE) { default: /// Fix non standard entity notations - $text = preg_replace('/(&#[0-9]+)(;?)/', "\\1;", $text); - $text = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', "\\1;", $text); + $text = preg_replace('/�*([0-9]+);?/', "&#\\1;", $text); + $text = preg_replace('/�*([0-9a-fA-F]+);?/', "&#x\\1;", $text); /// Remove tags that are not allowed $text = strip_tags($text, $ALLOWED_TAGS);