From 10c488e1d05734e4e939db71a3ab9448c6e2ad11 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sat, 29 Mar 2025 10:36:08 +0000 Subject: Strip '[\r\n\t]' from entry content during filter test. This is to help get the content and regex match strings a bit closer. --- classes/Pref_Filters.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/Pref_Filters.php b/classes/Pref_Filters.php index 3e97309ac..e30a1468c 100644 --- a/classes/Pref_Filters.php +++ b/classes/Pref_Filters.php @@ -168,7 +168,6 @@ class Pref_Filters extends Handler_Protected { $entry['author'], $entry_tags, $matched_rules); if (count($rc) > 0) { - $entry_content_text = strip_tags($entry["content"]); $content_preview = ""; $matches = []; @@ -186,6 +185,9 @@ class Pref_Filters extends Handler_Protected { $matches[] = $rule_regexp_match; 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"])); + $match_index = mb_strpos($entry_content_text, $rule_regexp_match); $content_preview = truncate_string(mb_substr($entry_content_text, $match_index), 200); -- cgit v1.2.3-54-g00ecf