From 3cf317769d00ec75adb03e9fa211805c71186f27 Mon Sep 17 00:00:00 2001 From: CollectiveAccess Date: Fri, 9 Aug 2024 13:42:20 -0400 Subject: [PATCH] Resolves #109 --- app/lib/Search/SearchResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/Search/SearchResult.php b/app/lib/Search/SearchResult.php index 01822aad1d..58a2502837 100755 --- a/app/lib/Search/SearchResult.php +++ b/app/lib/Search/SearchResult.php @@ -3945,7 +3945,7 @@ private function highlight($content) { return strlen($b) <=> strlen($a); }); - $content = $g_highlight_cache[$content] = preg_replace("/(?\\1", $content); + $content = $g_highlight_cache[$content] = preg_replace("/(?<= |^)(".join('|', $highlight_text).")/i", "\\1", $content); return $content; }