mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Prevent adjacent hyphens in a HTML/XML comment. Fixes #6642 for trunk. Props schiller.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a030bdbd5d
commit
eb1f1ece79
@ -431,6 +431,10 @@ function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
|
||||
$string = $newstring;
|
||||
if ( $string == '' )
|
||||
return '';
|
||||
// prevent multiple dashes in comments
|
||||
$string = preg_replace('/--+/', '-', $string);
|
||||
// prevent three dashes closing a comment
|
||||
$string = preg_replace('/-$/', '', $string);
|
||||
return "<!--{$string}-->";
|
||||
}
|
||||
# Allow HTML comments
|
||||
@ -1052,4 +1056,4 @@ function kses_init() {
|
||||
|
||||
add_action('init', 'kses_init');
|
||||
add_action('set_current_user', 'kses_init');
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user