From 0dbb619f9d5ef8beae4f263482bbc9abfe7de823 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Mon, 22 Jun 2015 16:23:46 +0100 Subject: [PATCH] Issue #2506349 by alexpott: Unnecessary looping in Xss::filter when processing attributes --- core/lib/Drupal/Component/Utility/Xss.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/lib/Drupal/Component/Utility/Xss.php b/core/lib/Drupal/Component/Utility/Xss.php index 4c6e812694e..f967ca6264c 100644 --- a/core/lib/Drupal/Component/Utility/Xss.php +++ b/core/lib/Drupal/Component/Utility/Xss.php @@ -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];