From faec539a8b1f47953acfa40f8571b16ff2da808f Mon Sep 17 00:00:00 2001 From: xjm Date: Sat, 6 Jun 2015 20:00:47 -0500 Subject: [PATCH] Issue #2501747 by cwells, joelpittet, peezy: Remove SafeMarkup::set in search_excerpt --- core/modules/search/search.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 462e4db15bd..b4c41266f71 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -8,6 +8,7 @@ use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Unicode; +use Drupal\Component\Utility\Xss; use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; @@ -767,7 +768,7 @@ function search_excerpt($keys, $text, $langcode = NULL) { // Highlight keywords. Must be done at once to prevent conflicts ('strong' // and ''). $text = trim(preg_replace('/' . $boundary . '(?:' . implode('|', $keys) . ')' . $boundary . '/iu', '\0', ' ' . $text . ' ')); - return SafeMarkup::set($text); + return Xss::filter($text, ['strong']); } /**