Commit 7e6bb21f authored by Andrew Dolgov's avatar Andrew Dolgov

auto_assign_labels: pass delimiter to preg_quote() to escape slashes properly

parent bcdbfa7c
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment