properly highlight search keywords containing forward slash

This commit is contained in:
Andrew Dolgov 2017-12-15 08:33:59 +03:00
parent f559d74a4e
commit 0f05147531
1 changed files with 3 additions and 1 deletions

View File

@ -557,7 +557,9 @@ class Feeds extends Handler_Protected {
if ($highlight_words && count($highlight_words) > 0) {
foreach ($highlight_words as $word) {
$line["title"] = preg_replace("/(\Q$word\E)/i",
$word = preg_quote($word, "/");
$line["title"] = preg_replace("/($word)/i",
"<span class=\"highlight\">$1</span>", $line["title"]);
}
}