summaryrefslogtreecommitdiff
path: root/include/rssfuncs.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-08-26 14:45:34 +0300
committerAndrew Dolgov <[email protected]>2016-08-26 14:45:34 +0300
commit557d86fe42e38a43b023b78af782dc509e4581f7 (patch)
treedad9fb85d0540a66019b7e1121cfdaafaebc1767 /include/rssfuncs.php
parent4719aaca8a78d7606274c999eeceb93b93b2e3aa (diff)
better debugging for matched filter rules
Diffstat (limited to 'include/rssfuncs.php')
-rw-r--r--include/rssfuncs.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index cbd011e5c..32bc69819 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -798,12 +798,21 @@
/* Collect article tags here so we could filter by them: */
+ $matched_rules = array();
+
$article_filters = get_article_filters($filters, $article["title"],
$article["content"], $article["link"], 0, $article["author"],
- $article["tags"]);
+ $article["tags"], $matched_rules);
if ($debug_enabled) {
- _debug("article filters: ", $debug_enabled);
+ _debug("matched filter rules: ", $debug_enabled);
+
+ if (count($matched_rules) != 0) {
+ print_r($matched_rules);
+ }
+
+ _debug("filter actions: ", $debug_enabled);
+
if (count($article_filters) != 0) {
print_r($article_filters);
}
@@ -850,7 +859,10 @@
if ($debug_enabled) {
_debug("article labels:", $debug_enabled);
- print_r($article_labels);
+
+ if (count($article_labels) != 0) {
+ print_r($article_labels);
+ }
}
_debug("force catchup: $entry_force_catchup");
@@ -1352,7 +1364,7 @@
return $params;
}
- function get_article_filters($filters, $title, $content, $link, $timestamp, $author, $tags) {
+ function get_article_filters($filters, $title, $content, $link, $timestamp, $author, $tags, &$matched_rules = false) {
$matches = array();
foreach ($filters as $filter) {
@@ -1418,6 +1430,8 @@
if ($inverse) $filter_match = !$filter_match;
if ($filter_match) {
+ if (is_array($matched_rules)) array_push($matched_rules, $rule);
+
foreach ($filter["actions"] AS $action) {
array_push($matches, $action);