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

This commit is contained in:
Andrew Dolgov 2018-02-23 13:31:08 +03:00
parent bcdbfa7c67
commit 7e6bb21ff5
1 changed files with 2 additions and 2 deletions

4
plugins/auto_assign_labels/init.php Normal file → Executable file
View File

@ -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;
}
}
}