From 581b81006af157d0fa12b8d1e2604c637234f778 Mon Sep 17 00:00:00 2001 From: Tommaso Ferrari Date: Wed, 22 Oct 2025 12:28:33 -0700 Subject: Add option to apply filter actions to existing articles (#7959) * Add option to apply filter actions to existing articles * make fix-all * Fixes * Another approach with preview New approach: https://github.com/FreshRSS/FreshRSS/pull/7959/commits/20479475c90ac954b991b3703c3cc76c16aa2d5c image Additional improvements: * Also implemented at category level, and at global level * Also implemented for favourites at global level Shortcomings: * Does not always work reliably with advanced regex, since the DB's flavour is not necessarily the same than PHP's Related: https://github.com/FreshRSS/FreshRSS/pull/8141 * make fix-all --------- Co-authored-by: Alexandre Alapetite --- app/Controllers/configureController.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 427fcb584..17c6c20bd 100644 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -180,6 +180,25 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_View::prependTitle(_t('conf.reading.title') . ' ยท '); } + public function viewFilterAction(): void { + $search = ''; + $filters_name = Minz_Request::paramString('filters_name', plaintext: true); + $filteractions = Minz_Request::paramTextToArray($filters_name); + $filteractions = array_map(fn(string $action): string => trim($action), $filteractions); + $filteractions = array_filter($filteractions, fn(string $action): bool => $action !== ''); + foreach ($filteractions as $action) { + $search .= "($action) OR "; + } + $search = preg_replace('/ OR $/', '', $search); + Minz_Request::forward([ + 'c' => 'index', + 'a' => 'index', + 'params' => [ + 'search' => $search, + ], + ], redirect: true); + } + /** * This action handles the integration configuration page. * -- cgit v1.2.3