diff options
Diffstat (limited to 'service/app/search')
-rw-r--r-- | service/app/search/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/service/app/search/__init__.py b/service/app/search/__init__.py index 22f4795b..c89ae704 100644 --- a/service/app/search/__init__.py +++ b/service/app/search/__init__.py @@ -1,4 +1,5 @@ from scanner import StringScanner, StringRegexp +import re def _next_token(): @@ -23,8 +24,8 @@ class SearchQuery: @staticmethod def compile(query): compiled = {"tags": [], "not_tags": []} - - scanner = StringScanner(query.encode('utf8').replace("\"", "")) + sanitized_query = re.sub(r"['\"]", "", query.encode('utf8')) + scanner = StringScanner(sanitized_query) first_token = True while not scanner.is_eos: token = scanner.scan(_next_token()) |