MDL-21026 improved entity handling

This commit is contained in:
Petr Skoda
2009-12-02 21:14:02 +00:00
parent 621c41ae2b
commit 72f8b520a1
+2 -2
View File
@@ -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*([0-9]+);?/', "&#\\1;", $text);
$text = preg_replace('/&#x0*([0-9a-fA-F]+);?/', "&#x\\1;", $text);
/// Remove tags that are not allowed
$text = strip_tags($text, $ALLOWED_TAGS);