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.
master
Dmitry Konishchev 12 years ago
parent 8cefe38a0a
commit 7b80b5e160

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

Loading…
Cancel
Save