Fix comment search query ampersand bug.

remotes/1693176582716663532/tmp_refs/heads/watchparty
Snakes 2022-10-27 18:24:12 -04:00
parent 8e2c869c84
commit be7be28182
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 1 additions and 0 deletions

View File

@ -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),