From d81dbc44b80c061bcea7efeb778be45082e1dcc6 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 1 Apr 2025 09:39:16 +0200 Subject: Fix escaping of tag search (#7468) * Fix escaping of tag search fix https://github.com/FreshRSS/FreshRSS/issues/7466 * Minor clarity --- app/Controllers/tagController.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/Controllers') diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php index cb3f164f5..68047656e 100644 --- a/app/Controllers/tagController.php +++ b/app/Controllers/tagController.php @@ -204,4 +204,9 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController { $tagDAO = FreshRSS_Factory::createTagDao(); $this->view->tags = $tagDAO->listTags(precounts: true); } + + public static function escapeForSearch(string $tag): string { + $tag = htmlspecialchars_decode($tag, ENT_QUOTES); + return str_replace([' ', '(', ')'], ['+', '\\(', '\\)'], $tag); + } } -- cgit v1.2.3