1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-14 08:40:11 +01:00

[fix] correct search parameter check

This commit is contained in:
Adam Tauber 2017-01-21 20:21:32 +01:00
parent 2522254fb2
commit e7aa98902f

View File

@ -219,7 +219,7 @@ def get_search_query_from_webapp(preferences, form):
query_lang = preferences.get_value('language') query_lang = preferences.get_value('language')
# check 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) raise SearxParameterException('language', query_lang)
# get safesearch # get safesearch
@ -240,7 +240,7 @@ def get_search_query_from_webapp(preferences, form):
query_time_range = form.get('time_range') query_time_range = form.get('time_range')
# check 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) raise SearxParameterException('time_range', query_time_range)
# query_engines # query_engines