summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-05-19 11:16:57 +0200
committerAdam Tauber <asciimoo@gmail.com>2015-05-19 11:16:57 +0200
commitb09aaf126e38106682e88e4fcd2760344fd839f2 (patch)
tree4b3ba6dc66c6cf6f9eec85873aae74438472d861
parent333b6759ace92e4e16279dc200c3ed53c37446f0 (diff)
downloadsearxng-b09aaf126e38106682e88e4fcd2760344fd839f2.tar.gz
searxng-b09aaf126e38106682e88e4fcd2760344fd839f2.zip
[mod] allow whitespaces in category/engine list
-rw-r--r--searx/search.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/search.py b/searx/search.py
index 1ec1c377d..e7ac7bb66 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -386,11 +386,11 @@ class Search(object):
load_default_categories = True
for pd_name, pd in self.request_data.items():
if pd_name == 'categories':
- self.categories.extend(categ for categ in pd.split(',') if categ in categories)
+ self.categories.extend(categ.strip() for categ in pd.split(',') if categ in categories)
elif pd_name == 'engines':
pd_engines = [{'category': engines[engine].categories[0],
'name': engine}
- for engine in pd.split(',') if engine in engines]
+ for engine in map(str.strip, pd.split(',')) if engine in engines]
if pd_engines:
self.engines.extend(pd_engines)
load_default_categories = False