Prevent adjacent hyphens in a HTML/XML comment. Fixes #6642 for trunk. Props schiller.
git-svn-id: https://develop.svn.wordpress.org/trunk@8382 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4cd1b1c3a0
commit
124ca7ff00
|
@ -431,6 +431,10 @@ function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
|
||||||
$string = $newstring;
|
$string = $newstring;
|
||||||
if ( $string == '' )
|
if ( $string == '' )
|
||||||
return '';
|
return '';
|
||||||
|
// prevent multiple dashes in comments
|
||||||
|
$string = preg_replace('/--+/', '-', $string);
|
||||||
|
// prevent three dashes closing a comment
|
||||||
|
$string = preg_replace('/-$/', '', $string);
|
||||||
return "<!--{$string}-->";
|
return "<!--{$string}-->";
|
||||||
}
|
}
|
||||||
# Allow HTML comments
|
# Allow HTML comments
|
||||||
|
|
Loading…
Reference in New Issue