Sanitize more special characters in search.
parent
7defcd07cf
commit
6757831e0f
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue