From be7be28182b10cb2737d450520e117fa1c16f97e Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 27 Oct 2022 18:24:12 -0400 Subject: [PATCH] Fix comment search query ampersand bug. --- files/routes/search.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/search.py b/files/routes/search.py index 07795a0c5..9b05f7b05 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -208,6 +208,7 @@ def searchcomments(v): if 'q' in criteria: tokens = map(lambda x: re.sub(r'[\0():|&*!<>]', '', x), criteria['q']) + tokens = filter(lambda x: len(x) > 0, tokens) tokens = map(lambda x: re.sub(r'\s+', ' <-> ', x), tokens) comments = comments.filter(Comment.body_ts.match( ' & '.join(tokens),