diff options
author | Adam Tauber <asciimoo@gmail.com> | 2017-01-21 20:21:32 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-01-21 20:21:32 +0100 |
commit | e7aa98902f531b12adc26f7d3ee8c32a2e3d6bc1 (patch) | |
tree | abb27bd795400e133b2b23bd80c6194d1837e361 /searx/search.py | |
parent | 2522254fb2d44e36fe556765fb0b5c851583f05f (diff) | |
download | searxng-e7aa98902f531b12adc26f7d3ee8c32a2e3d6bc1.tar.gz searxng-e7aa98902f531b12adc26f7d3ee8c32a2e3d6bc1.zip |
[fix] correct search parameter check
Diffstat (limited to 'searx/search.py')
-rw-r--r-- | searx/search.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/search.py b/searx/search.py index 0cb53c418..1da3c17a8 100644 --- a/searx/search.py +++ b/searx/search.py @@ -219,7 +219,7 @@ def get_search_query_from_webapp(preferences, form): query_lang = preferences.get_value('language') # check language - if query_lang not in language_code_set: + if query_lang.lower() not in language_code_set: raise SearxParameterException('language', query_lang) # get safesearch @@ -240,7 +240,7 @@ def get_search_query_from_webapp(preferences, form): query_time_range = form.get('time_range') # check time_range - if query_time_range not in [None, '', 'day', 'week', 'month', 'year']: + if query_time_range not in ('None', None, '', 'day', 'week', 'month', 'year'): raise SearxParameterException('time_range', query_time_range) # query_engines |