Issue #2506349 by alexpott: Unnecessary looping in Xss::filter when processing attributes

8.0.x
Nathaniel Catchpole 2015-06-22 16:23:46 +01:00
parent a1bc737216
commit 0dbb619f9d
1 changed files with 1 additions and 2 deletions

View File

@ -143,11 +143,10 @@ class Xss {
return '<';
}
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9\-]+)([^>]*)>?|(<!--.*?-->)$%', $string, $matches)) {
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9\-]+)\s*([^>]*)>?|(<!--.*?-->)$%', $string, $matches)) {
// Seriously malformed.
return '';
}
$slash = trim($matches[1]);
$elem = &$matches[2];
$attrlist = &$matches[3];