diff options
author | Adam Tauber <asciimoo@gmail.com> | 2017-12-01 20:44:31 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-12-01 20:54:12 +0100 |
commit | a065fcdcc95beaf7028b55c9bd82591add99a890 (patch) | |
tree | 12892bbe6c163621083544e2257375f24cb2d44b /searx | |
parent | 43855a089786245bf113f278bf42e6c5f636496a (diff) | |
download | searxng-a065fcdcc95beaf7028b55c9bd82591add99a890.tar.gz searxng-a065fcdcc95beaf7028b55c9bd82591add99a890.zip |
[fix] skip non-string result url/title/content
Diffstat (limited to 'searx')
-rw-r--r-- | searx/results.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/searx/results.py b/searx/results.py index 1939b9483..cb204a682 100644 --- a/searx/results.py +++ b/searx/results.py @@ -170,10 +170,16 @@ class ResultContainer(object): self.paging = True for i, result in enumerate(results): + if 'url' in result and not isinstance(result['url'], basestring): + continue try: result['url'] = result['url'].decode('utf-8') except: pass + if 'title' in result and not isinstance(result['title'], basestring): + continue + if 'content' in result and not isinstance(result['content'], basestring): + continue position = i + 1 self._merge_result(result, position) |