Allow XML attributes with colons to be read by kses.

The attribute would still need to be whitelisted to get through the filters.

props jorbin.
fixes #17847.


git-svn-id: https://develop.svn.wordpress.org/trunk@27707 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-03-25 12:52:48 +00:00
parent 3e28e2fae8
commit 89f16d1887

View File

@ -763,10 +763,10 @@ function wp_kses_hair($attr, $allowed_protocols) {
switch ($mode) { switch ($mode) {
case 0 : # attribute name, href for instance case 0 : # attribute name, href for instance
if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) { if ( preg_match('/^([-a-zA-Z:]+)/', $attr, $match ) ) {
$attrname = $match[1]; $attrname = $match[1];
$working = $mode = 1; $working = $mode = 1;
$attr = preg_replace('/^[-a-zA-Z]+/', '', $attr); $attr = preg_replace( '/^[-a-zA-Z:]+/', '', $attr );
} }
break; break;