Match each tag separately against user filter regular expression

Each article's tag should be matched against user filter regular
expression separately. Current matching confuses when you want to match
an exact tag. You suppose to write "^tag$", bug now have to write
"(^|,)tag(,|$)" which is very inconvenient and requires knowledge about
how do you process this matching.
This commit is contained in:
Dmitry Konishchev 2013-04-26 15:54:04 +04:00
parent 8cefe38a0a
commit 7b80b5e160

View file

@ -1271,8 +1271,12 @@
$match = @preg_match("/$reg_exp/i", $author);
break;
case "tag":
$tag_string = join(",", $tags);
$match = @preg_match("/$reg_exp/i", $tag_string);
foreach ($tags as $tag) {
if (@preg_match("/$reg_exp/i", $tag)) {
$match = true;
break;
}
}
break;
}