ZF-11617: Zend_Filter_StripTags does not handle hyphenated attribute names
Description
In Zend_Filter_StripTags, the regex to parse well-formed attributes should take dashes into account to support HTML5 data-* attributes:
Instead of checking for
(\w+)
it should at least do this
// Parse iteratively for well-formed attributes
preg_match_all('/([a-z\-]+)\s*=\s*(?:(")(.*?)"|(\')(.*?)\')/s', $tagAttributes, $matches);
Comments
Posted by Adam Lundrigan (adamlundrigan) on 2011-07-28T16:50:47.000+0000
Added the hyphen character to list of valid characters for an attribute name:
Fix and unit test committed to trunk in r24277 Merged to release-1.11 in r24278
Posted by Thomas Weidner (thomas) on 2011-08-26T19:25:29.000+0000
Added in ZF2 with GH-285