Improve kses handling of attributes in valid XHTML self closed img tags. Fixes #12394 props dougal.
git-svn-id: https://develop.svn.wordpress.org/trunk@13561 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c9dfdbc8c6
commit
64dce47ade
|
@ -538,7 +538,7 @@ function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) {
|
||||||
# Is there a closing XHTML slash at the end of the attributes?
|
# Is there a closing XHTML slash at the end of the attributes?
|
||||||
|
|
||||||
$xhtml_slash = '';
|
$xhtml_slash = '';
|
||||||
if (preg_match('%\s/\s*$%', $attr))
|
if (preg_match('%\s*/\s*$%', $attr))
|
||||||
$xhtml_slash = ' /';
|
$xhtml_slash = ' /';
|
||||||
|
|
||||||
# Are any attributes allowed at all for this element?
|
# Are any attributes allowed at all for this element?
|
||||||
|
@ -664,7 +664,7 @@ function wp_kses_hair($attr, $allowed_protocols) {
|
||||||
|
|
||||||
case 2 : # attribute value, a URL after href= for instance
|
case 2 : # attribute value, a URL after href= for instance
|
||||||
|
|
||||||
if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match))
|
if (preg_match('%^"([^"]*)"(\s+|/?$)%', $attr, $match))
|
||||||
# "value"
|
# "value"
|
||||||
{
|
{
|
||||||
$thisval = $match[1];
|
$thisval = $match[1];
|
||||||
|
@ -680,7 +680,7 @@ function wp_kses_hair($attr, $allowed_protocols) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match("/^'([^']*)'(\s+|$)/", $attr, $match))
|
if (preg_match("%^'([^']*)'(\s+|/?$)%", $attr, $match))
|
||||||
# 'value'
|
# 'value'
|
||||||
{
|
{
|
||||||
$thisval = $match[1];
|
$thisval = $match[1];
|
||||||
|
@ -696,7 +696,7 @@ function wp_kses_hair($attr, $allowed_protocols) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match("%^([^\s\"']+)(\s+|$)%", $attr, $match))
|
if (preg_match("%^([^\s\"']+)(\s+|/?$)%", $attr, $match))
|
||||||
# value
|
# value
|
||||||
{
|
{
|
||||||
$thisval = $match[1];
|
$thisval = $match[1];
|
||||||
|
|
Loading…
Reference in New Issue