]> git.wh0rd.org Git - tt-rss.git/commitdiff
Match each tag separately against user filter regular expression
authorDmitry Konishchev <konishchev@gmail.com>
Fri, 26 Apr 2013 11:54:04 +0000 (15:54 +0400)
committerDmitry Konishchev <konishchev@gmail.com>
Fri, 26 Apr 2013 12:30:25 +0000 (16:30 +0400)
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.

include/rssfuncs.php

index 0cd41dc059c8510a94b02d4c2357c00b0962a089..f4f9fa53c60a437343adeb357f8eb37a81eee5a1 100644 (file)
                                        $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;
                                }