From f9fd129f28d1cf9d867fecd058d5cc3735073db8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 25 Mar 2014 12:53:16 +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. Built from https://develop.svn.wordpress.org/trunk@27707 git-svn-id: http://core.svn.wordpress.org/trunk@27546 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/kses.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/kses.php b/wp-includes/kses.php index 45ee6f61b6..103e2e42a2 100644 --- a/wp-includes/kses.php +++ b/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;