MDL-24565 control characters stripped so xml output functions correctly

now without unicode regular expression
This commit is contained in:
Jenny Gray 2010-10-13 14:08:02 +00:00
parent daff57fb3b
commit 64f1e408fa

View File

@ -1299,7 +1299,7 @@ function wikify_links($string) {
function fix_non_standard_entities($string) {
$text = preg_replace('/&#0*([0-9]+);?/', '&#$1;', $string);
$text = preg_replace('/&#x0*([0-9a-fA-F]+);?/', '&#x$1;', $text);
$text = preg_replace('/\p{Cc}/u', ' ', $text);
$text = preg_replace('[\x00-\x08\x0b-\x0c\x0e-\x1f]', '', $text);
return $text;
}