Issue #2501747 by cwells, joelpittet, peezy: Remove SafeMarkup::set in search_excerpt

8.0.x
xjm 2015-06-06 20:00:47 -05:00
parent 98cddda4b3
commit faec539a8b
1 changed files with 2 additions and 1 deletions

View File

@ -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 '<strong>').
$text = trim(preg_replace('/' . $boundary . '(?:' . implode('|', $keys) . ')' . $boundary . '/iu', '<strong>\0</strong>', ' ' . $text . ' '));
return SafeMarkup::set($text);
return Xss::filter($text, ['strong']);
}
/**