From 7b80b5e1600f9b0ffda7da6fcb717223b31a310d Mon Sep 17 00:00:00 2001
From: Dmitry Konishchev <konishchev@gmail.com>
Date: Fri, 26 Apr 2013 15:54:04 +0400
Subject: [PATCH] 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.
---
 include/rssfuncs.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 0cd41dc05..f4f9fa53c 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -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;
 				}
 
-- 
GitLab