MDL-21026 improved entity handling
This commit is contained in:
+2
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user