From 13632f8082ecae3d70c749d6093b2b4f691fdb5f Mon Sep 17 00:00:00 2001 From: Sean Colombo Date: Wed, 11 Aug 2010 07:19:26 +0000 Subject: [PATCH] Fix to #17031. See bug ticket for test code & test-results. --- includes/Sanitizer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index e8a3a38a5d..c0b85f962b 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -40,10 +40,11 @@ define( 'MW_CHAR_REFS_REGEX', * Allows some... latitude. * Used in Sanitizer::fixTagAttributes and Sanitizer::decodeTagAttributes */ -$attrib = '[A-Za-z0-9]'; +$attrib_first = '[:A-Z_a-z]'; +$attrib = '[:A-Z_a-z-.0-9]'; $space = '[\x09\x0a\x0d\x20]'; define( 'MW_ATTRIBS_REGEX', - "/(?:^|$space)((?:xml:|xmlns:)?$attrib+) + "/(?:^|$space)({$attrib_first}{$attrib}*) ($space*=$space* (?: # The attribute value: quoted or alone -- 2.20.1