From 8587efa62189a30e3e47075739382d52ecc34cb6 Mon Sep 17 00:00:00 2001 From: papaschloss <11808509+papaschloss@users.noreply.github.com> Date: Mon, 15 Aug 2022 12:01:18 -0700 Subject: Article css filtering (#4501) * Update feedController.php * Update subscriptionController.php * Update DatabaseDAO.php * Update Entry.php * Update Feed.php * Update FeedDAO.php * Update install.sql.mysql.php * Update install.sql.pgsql.php * Update install.sql.sqlite.php * Update sub.php * Update opml.phtml * Update ImportService.php * Update update.phtml * Update feed.js * Update install.sql.mysql.php * Update install.sql.pgsql.php * Update install.sql.sqlite.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update sub.php * Update FeedDAO.php * Update feedController.php * Update subscriptionController.php * Update Entry.php * Update Feed.php * Update feedController.php * Update subscriptionController.php * Update ImportService.php * Update opml.phtml * Update update.phtml * Update update.phtml * Update update.phtml * Update DatabaseDAO.php * Update app/Models/Entry.php Co-authored-by: Alexandre Alapetite * Update app/i18n/fr/sub.php Co-authored-by: Alexandre Alapetite * Update p/scripts/feed.js Co-authored-by: Alexandre Alapetite * Update app/Controllers/feedController.php * make fix-all * Update documentation * css_path_filter help message * i18n en-us ignore Co-authored-by: Alexandre Alapetite --- app/Models/Entry.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/Models/Entry.php') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 0be353c28..d20f5f2a7 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -558,6 +558,12 @@ class FreshRSS_Entry extends Minz_Model { $nodes = $xpath->query(new Gt\CssXPath\Translator($path)); if ($nodes != false) { foreach ($nodes as $node) { + if (!empty($attributes['path_entries_filter'])) { + $filterednodes = $xpath->query(new Gt\CssXPath\Translator($attributes['path_entries_filter']), $node); + foreach ($filterednodes as $filterednode) { + $filterednode->parentNode->removeChild($filterednode); + } + } $content .= $doc->saveHtml($node) . "\n"; } } -- cgit v1.2.3