From 89f16d188774509a08278855880ca67619878bd6 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 25 Mar 2014 12:52:48 +0000 Subject: [PATCH] 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 --- src/wp-includes/kses.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php index 45ee6f61b6..103e2e42a2 100644 --- a/src/wp-includes/kses.php +++ b/src/wp-includes/kses.php @@ -763,10 +763,10 @@ function wp_kses_hair($attr, $allowed_protocols) { switch ($mode) { 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]; $working = $mode = 1; - $attr = preg_replace('/^[-a-zA-Z]+/', '', $attr); + $attr = preg_replace( '/^[-a-zA-Z:]+/', '', $attr ); } break;