git-svn-id: http://svn.automattic.com/wordpress/trunk@3417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0962ff9bff
commit
ea84ce4551
|
@ -77,7 +77,7 @@ function wp_kses_split($string, $allowed_html, $allowed_protocols)
|
||||||
# matches stray ">" characters.
|
# matches stray ">" characters.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
{
|
{
|
||||||
return preg_replace('%(<'.# EITHER: <
|
return preg_replace('%(<!--.*?-->)|(<'.# EITHER: <
|
||||||
'[^>]*'.# things that aren't >
|
'[^>]*'.# things that aren't >
|
||||||
'(>|$)'.# > or end of string
|
'(>|$)'.# > or end of string
|
||||||
'|>)%e', # OR: just a >
|
'|>)%e', # OR: just a >
|
||||||
|
@ -98,6 +98,10 @@ function wp_kses_split2($string, $allowed_html, $allowed_protocols)
|
||||||
return '>';
|
return '>';
|
||||||
# It matched a ">" character
|
# It matched a ">" character
|
||||||
|
|
||||||
|
if (preg_match('%^<!--.*-->$%', $string))
|
||||||
|
return $string;
|
||||||
|
# Allow HTML comments
|
||||||
|
|
||||||
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches))
|
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches))
|
||||||
return '';
|
return '';
|
||||||
# It's seriously malformed
|
# It's seriously malformed
|
||||||
|
|
Loading…
Reference in New Issue