diff --git a/core/lib/Drupal/Component/Utility/Xss.php b/core/lib/Drupal/Component/Utility/Xss.php index be81948..75b90b5 100644 --- a/core/lib/Drupal/Component/Utility/Xss.php +++ b/core/lib/Drupal/Component/Utility/Xss.php @@ -85,9 +85,8 @@ public static function filter($string, $html_tags = array('a', 'em', 'strong', ' // Named entities. $string = preg_replace('/&([A-Za-z][A-Za-z0-9]*;)/', '&\1', $string); $html_tags = array_flip($html_tags); - $class = get_called_class(); - $splitter = function ($matches) use ($html_tags, $class, $mode) { - return $class::split($matches, $html_tags, $mode); + $splitter = function ($matches) use ($html_tags, $mode) { + return static::split($matches[1], $html_tags, $mode); }; return preg_replace_callback('% ( @@ -125,13 +124,8 @@ public static function filterAdmin($string) { /** * Processes an HTML tag. * - * Call \Drupal\Component\Xss\filter() instead of this helper. - * - * @param array $matches - * An array with various meaning depending on the value of $store. - * If $store is TRUE then the array contains the allowed tags. - * If $store is FALSE then the array has one element, the HTML tag to - * process. + * @param string $string + * The HTML tag to process. * @param array $html_tags * An array where the keys are the allowed tags and the values are not * used. @@ -143,9 +137,7 @@ public static function filterAdmin($string) { * If the element isn't allowed, an empty string. Otherwise, the cleaned up * version of the HTML element. */ - public static function split($matches, $html_tags, $split_mode = Xss::FILTER_MODE_WHITELIST) { - $string = $matches[1]; - + protected static function split($string, $html_tags, $split_mode) { if (substr($string, 0, 1) != '<') { // We matched a lone ">" character. return '>';