]> git.wh0rd.org Git - tt-rss.git/commitdiff
properly highlight search keywords containing forward slash
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 15 Dec 2017 05:33:59 +0000 (08:33 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 15 Dec 2017 05:33:59 +0000 (08:33 +0300)
classes/feeds.php

index 58661994540f4bad520ee74909def6818a9e92c0..64880b02d9aca408d17026a95897524b2fcd6be0 100755 (executable)
@@ -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"]);
                                                }
                                        }