aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-04-01 09:39:16 +0200
committerGravatar GitHub <noreply@github.com> 2025-04-01 09:39:16 +0200
commitd81dbc44b80c061bcea7efeb778be45082e1dcc6 (patch)
tree3e4f35b81d9ac9030db630d17f02be2c5655e150 /app/Controllers
parent426e3054c237c2b98667ebeacbbdb5caa88e7b1f (diff)
Fix escaping of tag search (#7468)
* Fix escaping of tag search fix https://github.com/FreshRSS/FreshRSS/issues/7466 * Minor clarity
Diffstat (limited to 'app/Controllers')
-rw-r--r--app/Controllers/tagController.php5
1 files changed, 5 insertions, 0 deletions
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);
+ }
}