summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2025-03-30 20:21:06 +0300
committerAndrew Dolgov <fox@fakecake.org>2025-03-30 20:21:06 +0300
commitb4962b670d02f7c5d4da3cafe99cffffe059e8a1 (patch)
treeb1f8a8f87632e671e9f9034721841fef9cacef44 /classes
parent10c488e1d05734e4e939db71a3ab9448c6e2ad11 (diff)
stop sending matched content twice for the tooltip, use smaller objects containing only regular expression and rule type
Diffstat (limited to 'classes')
-rw-r--r--classes/Pref_Filters.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/classes/Pref_Filters.php b/classes/Pref_Filters.php
index e30a1468c..d5844b902 100644
--- a/classes/Pref_Filters.php
+++ b/classes/Pref_Filters.php
@@ -171,6 +171,7 @@ class Pref_Filters extends Handler_Protected {
$content_preview = "";
$matches = [];
+ $rules = [];
$entry_title = $entry["title"];
@@ -184,6 +185,11 @@ class Pref_Filters extends Handler_Protected {
$matches[] = $rule_regexp_match;
+ $rules[] = [
+ 'reg_exp' => $rule['reg_exp'],
+ 'type' => $rule['type']
+ ];
+
if (in_array($rule['type'], ['content', 'both'])) {
// also stripping [\r\n\t] to match what's done for content in RSSUtils#get_article_filters()
$entry_content_text = strip_tags(preg_replace("/[\r\n\t]/", "", $entry["content"]));
@@ -232,7 +238,7 @@ class Pref_Filters extends Handler_Protected {
'feed_title' => $entry['feed_title'],
'date' => mb_substr($entry['date_entered'], 0, 16),
'content_preview' => $content_preview,
- 'matched_rules' => $matched_rules, // TODO shorten object passed to frontend
+ 'rules' => $rules
];
}
}