diff --git a/files/routes/search.py b/files/routes/search.py index 136d544aa..2340dd0ba 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -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),