]> git.wh0rd.org Git - tt-rss.git/commitdiff
auto_assign_labels: pass delimiter to preg_quote() to escape slashes properly
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 23 Feb 2018 10:31:08 +0000 (13:31 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 23 Feb 2018 10:31:08 +0000 (13:31 +0300)
plugins/auto_assign_labels/init.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index cc70e2d..3fa4ad8
@@ -38,7 +38,7 @@ class Auto_Assign_Labels extends Plugin {
                $tags_str = join(",", $article["tags"]);
 
                foreach ($labels as $label) {
-                       $caption = preg_quote($label[1]);
+                       $caption = preg_quote($label[1], "/");
 
                        if ($caption && preg_match("/\b$caption\b/i", "$tags_str " . strip_tags($article["content"]) . " " . $article["title"])) {
 
@@ -54,4 +54,4 @@ class Auto_Assign_Labels extends Plugin {
        function api_version() {
                return 2;
        }
-}
\ No newline at end of file
+}