Better detection of HTML double-encoded entities

release-0.6
thomascube 18 years ago
parent 633142fa6b
commit fdebae88c2

@ -347,7 +347,7 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
$str = strip_tags($str);
// avoid douple quotation of &
$out = preg_replace('/&([a-z]{2,5}|#[0-9]{2,4});/', '&\\1;', strtr($str, $encode_arr));
$out = preg_replace('/&([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', strtr($str, $encode_arr));
return $newlines ? nl2br($out) : $out;
}

Loading…
Cancel
Save