MDL-24565 fix invalid XML unicode characters when uses KSES filtering - credit goes to Jenny Gray

This commit is contained in:
Petr Skoda 2010-10-08 09:22:56 +00:00
parent a4e56bf335
commit 6663b9d1e3

View File

@ -1298,6 +1298,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);
return $text;
}