summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index a1aabf9a5..28f49b61e 100644
--- a/functions.php
+++ b/functions.php
@@ -1181,7 +1181,7 @@
// error_reporting(0);
$article_filters = get_article_filters($filters, $entry_title,
- $entry_content, $entry_link, $entry_timestamp);
+ $entry_content, $entry_link, $entry_timestamp, $entry_author);
if (defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug']) {
_debug("update_rss_feed: article filters: ");
@@ -1505,7 +1505,7 @@
print "</select>";
}
- function get_article_filters($filters, $title, $content, $link, $timestamp) {
+ function get_article_filters($filters, $title, $content, $link, $timestamp, $author) {
$matches = array();
if ($filters["title"]) {
@@ -1590,6 +1590,18 @@
}
}
+ if ($filters["author"]) {
+ foreach ($filters["author"] as $filter) {
+ $reg_exp = $filter["reg_exp"];
+ $inverse = $filter["inverse"];
+ if ((!$inverse && preg_match("/$reg_exp/i", $author)) ||
+ ($inverse && !preg_match("/$reg_exp/i", $author))) {
+
+ array_push($matches, array($filter["action"], $filter["action_param"]));
+ }
+ }
+ }
+
return $matches;
}