Permalink
Browse files

MDL-24565 control characters stripped so xml output functions correctly

now without unicode regular expression
  • Loading branch information...
1 parent b9a87c8 commit 7d2c082b1a23b097270f8d9e300ed9bf4f8df56f @jennymgray jennymgray committed Oct 13, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/weblib.php
View
@@ -2026,6 +2026,7 @@ function clean_text($text, $format=FORMAT_MOODLE) {
/// Fix non standard entity notations
$text = preg_replace('/&#0*([0-9]+);?/', "&#\\1;", $text);
$text = preg_replace('/&#x0*([0-9a-fA-F]+);?/', "&#x\\1;", $text);
+ $text = preg_replace('[\x00-\x08\x0b-\x0c\x0e-\x1f]', '', $text);
/// Remove tags that are not allowed
$text = strip_tags($text, $ALLOWED_TAGS);

0 comments on commit 7d2c082

Please sign in to comment.