properly highlight search keywords containing forward slash

master
Andrew Dolgov 7 years ago
parent f559d74a4e
commit 0f05147531

@ -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"]);
} }
} }

Loading…
Cancel
Save