MDL-11413 improved text cleaning (problem reported by Andreas Nolden); backported from HEAD

This commit is contained in:
skodak
2007-09-23 12:24:39 +00:00
parent bde6d304f9
commit 4663bd9f09
+1
View File
@@ -1659,6 +1659,7 @@ function clean_text($text, $format=FORMAT_MOODLE) {
/// Fix non standard entity notations
$text = preg_replace('/(&#[0-9]+)(;?)/', "\\1;", $text);
$text = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', "\\1;", $text);
$text = str_replace(':', ':', $text);
/// Remove tags that are not allowed
$text = strip_tags($text, $ALLOWED_TAGS);