From e4821c546385e56d66d9b12f425c972791829ee3 Mon Sep 17 00:00:00 2001 From: Lukas Mechsner Date: Fri, 14 Feb 2020 16:03:14 +0100 Subject: [PATCH] [BUGFIX] add u flag --- src/SearchWordHighlighter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchWordHighlighter.php b/src/SearchWordHighlighter.php index 72f4fb5..d81cb16 100644 --- a/src/SearchWordHighlighter.php +++ b/src/SearchWordHighlighter.php @@ -92,7 +92,7 @@ public function highlight($words) }); // replace chained whitespace with a single space - $string = preg_replace('/[\s]+/s', ' ', $this->string); + $string = preg_replace('/[\s]+/us', ' ', $this->string); $string = html_entity_decode($string); if ($this->wordsBeforeMatch > 0) {