From 7e6bb21ff59167c75602b71157d679f23306c572 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 23 Feb 2018 13:31:08 +0300 Subject: [PATCH] auto_assign_labels: pass delimiter to preg_quote() to escape slashes properly --- plugins/auto_assign_labels/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 plugins/auto_assign_labels/init.php diff --git a/plugins/auto_assign_labels/init.php b/plugins/auto_assign_labels/init.php old mode 100644 new mode 100755 index cc70e2dff..3fa4ad8c0 --- a/plugins/auto_assign_labels/init.php +++ b/plugins/auto_assign_labels/init.php @@ -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 +}