Bläddra i källkod

[fix] engine selection from url

Adam Tauber 9 år sedan
förälder
incheckning
8c4d9b79d5
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2
    2
      searx/search.py

+ 2
- 2
searx/search.py Visa fil

@@ -391,11 +391,11 @@ class Search(object):
391 391
             load_default_categories = True
392 392
             for pd_name, pd in self.request_data.items():
393 393
                 if pd_name == 'categories':
394
-                    self.categories.extend(categ.strip() for categ in pd.split(',') if categ in categories)
394
+                    self.categories.extend(categ for categ in map(unicode.strip, pd.split(',')) if categ in categories)
395 395
                 elif pd_name == 'engines':
396 396
                     pd_engines = [{'category': engines[engine].categories[0],
397 397
                                    'name': engine}
398
-                                  for engine in map(str.strip, pd.split(',')) if engine in engines]
398
+                                  for engine in map(unicode.strip, pd.split(',')) if engine in engines]
399 399
                     if pd_engines:
400 400
                         self.engines.extend(pd_engines)
401 401
                         load_default_categories = False