Permalink
Browse files

MDL-21026 improved entity handling

  • Loading branch information...
1 parent d5f4161 commit d44b4a796d085256ab913d515bf20bed5e049796 @skodak skodak committed Dec 2, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/weblib.php
View
@@ -2023,8 +2023,8 @@ function clean_text($text, $format=FORMAT_MOODLE) {
$text = purify_html($text);
} else {
/// Fix non standard entity notations
- $text = preg_replace('/(&#[0-9]+)(;?)/', "\\1;", $text);
- $text = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', "\\1;", $text);
+ $text = preg_replace('/&#0*([0-9]+);?/', "&#\\1;", $text);
+ $text = preg_replace('/&#x0*([0-9a-fA-F]+);?/', "&#x\\1;", $text);
/// Remove tags that are not allowed
$text = strip_tags($text, $ALLOWED_TAGS);

0 comments on commit d44b4a7

Please sign in to comment.