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

View file

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