forked from MarseyWorld/MarseyWorld
search: escape apostrophes.
parent
7fe499ce41
commit
38ac92b4aa
|
@ -216,6 +216,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"'", "\\'", x), tokens)
|
||||
tokens = map(lambda x: re.sub(r'\s+', ' <-> ', x), tokens)
|
||||
comments = comments.filter(Comment.body_ts.match(
|
||||
' & '.join(tokens),
|
||||
|
|
Loading…
Reference in New Issue