Skip to content

Commit

Permalink
MDL-11413 revisited; backported from HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 24, 2007
1 parent 676dbd7 commit 7c84c84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1659,10 +1659,10 @@ function clean_text($text, $format=FORMAT_MOODLE) {
/// Fix non standard entity notations
$text = preg_replace('/(&#[0-9]+)(;?)/', "\\1;", $text);
$text = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', "\\1;", $text);
$text = str_replace(':', ':', $text);

/// Remove tags that are not allowed
$text = strip_tags($text, $ALLOWED_TAGS);
$text = str_replace(':', ':', $text);

/// Clean up embedded scripts and , using kses
$text = cleanAttributes($text);
Expand Down Expand Up @@ -1736,7 +1736,7 @@ function cleanAttributes2($htmlArray){
$value = kses_decode_entities($value);
$value = preg_replace('/(&#[0-9]+)(;?)/', "\\1;", $value);
$value = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', "\\1;", $value);
$value = str_replace(':', ':', $value);
$value = str_replace(':', '', $value); //better not have these characters in output at all
if ($value === $prevvalue) {
$arreach['value'] = $value;
break;
Expand Down

0 comments on commit 7c84c84

Please sign in to comment.