MDL-21026 improved entity handling

This commit is contained in:
Petr Skoda
2009-12-02 21:08:45 +00:00
parent 6c37c4c6c8
commit 7e4763ef61
+2 -2
View File
@@ -1149,8 +1149,8 @@ function wikify_links($string) {
* @return string
*/
function fix_non_standard_entities($string) {
$text = preg_replace('/(&#[0-9]+)(;?)/', '$1;', $string);
$text = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', '$1;', $text);
$text = preg_replace('/&#0*([0-9]+);?/', '&#$1;', $string);
$text = preg_replace('/&#x0*([0-9a-fA-F]+);?/', '&#x$1;', $text);
return $text;
}