Permalink
Browse files

MDL-21026 improved entity handling

  • Loading branch information...
skodak committed Dec 2, 2009
1 parent e5d838e commit 52860d13648f6b7f941c446f9e556f45be530c2d
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/weblib.php
View
@@ -1701,8 +1701,8 @@ function clean_text($text, $format=FORMAT_MOODLE) {
default:
/// 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 52860d1

Please sign in to comment.