summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/dictionary.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/engines/dictionary.py b/searx/engines/dictionary.py
index 080f7b4a4..b255463aa 100644
--- a/searx/engines/dictionary.py
+++ b/searx/engines/dictionary.py
@@ -25,6 +25,9 @@ def request(query, params):
from_lang = lan[0][1].lower()
else:
return params
+ elif from_lang.lower() not in [x[1].lower() for x in language_codes]:
+ return params
+
if len(to_lang) == 2:
lan = filter(lambda x: x[0][:2] == to_lang, language_codes)
@@ -32,6 +35,8 @@ def request(query, params):
to_lang = lan[0][1].lower()
else:
return params
+ elif to_lang.lower() not in [x[1].lower() for x in language_codes]:
+ return params
params['url'] = url.format(from_lang=from_lang, to_lang=to_lang,query=query)
params['from_lang'] = from_lang