diff --git a/core/lib/Drupal/Component/Utility/Xss.php b/core/lib/Drupal/Component/Utility/Xss.php index adbea58..60c3c08 100644 --- a/core/lib/Drupal/Component/Utility/Xss.php +++ b/core/lib/Drupal/Component/Utility/Xss.php @@ -39,7 +39,7 @@ class Xss { * * @see \Drupal\Component\Utility\Xss::filter() */ - protected static $safeAttributes = ['alt', 'title']; + protected static $safeAttributes = array('alt', 'title'); /** * The default list of RDFa attributes untouched by filter(). @@ -49,7 +49,7 @@ class Xss { * @see \Drupal\Component\Utility\Xss::filter() * @see http://www.w3.org/TR/xhtml-rdfa/ */ - protected static $rdfaAttributes = ['property', 'typeof', 'rel', 'rev', 'datatype']; + protected static $rdfaAttributes = array('property', 'typeof', 'rel', 'rev', 'datatype'); /** * Filters HTML to prevent cross-site-scripting (XSS) vulnerabilities. @@ -346,7 +346,7 @@ protected static function filterProtocol($name, $value) { // If the value matches the typical namespace:value pattern used in RDFa, // return it directly. Otherwise, filter it. if (in_array($name, static::$rdfaAttributes)) { - return preg_match('/^[[:alnum:]]+\:[[:alnum:]]+$/', $value) ? $value : UrlHelper::stripDangerousProtocols($value); + return preg_match('/[a-zA-Z0-9]+\:[a-zA-Z0-9]+$/', $value) ? $value : UrlHelper::stripDangerousProtocols($value); } else { return UrlHelper::filterBadProtocol($value);