From 6757831e0f2ef91a8c5d44011fb67cb09804c882 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 4 Oct 2022 01:31:27 -0400 Subject: [PATCH] Sanitize more special characters in search. --- files/routes/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/search.py b/files/routes/search.py index a3d1266da4..5c325d1ef4 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -207,7 +207,7 @@ def searchcomments(v): else: comments = comments.filter(Comment.author_id == author.id) if 'q' in criteria: - tokens = map(lambda x: re.sub(r'[\0():|&*!]', '', x), criteria['q']) + tokens = map(lambda x: re.sub(r'[\0():|&*!<>]', '', x), criteria['q']) tokens = map(lambda x: re.sub(r'\s+', ' <-> ', x), tokens) comments = comments.filter(Comment.body_ts.match( ' & '.join(tokens),