summaryrefslogtreecommitdiff
path: root/searx/engines/startpage.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2014-08-06 14:43:44 +0200
committerAdam Tauber <asciimoo@gmail.com>2014-08-06 14:43:44 +0200
commit111a86d355fe2fcbc714a478cb399ef47b79ec35 (patch)
tree2cc462a1f32660ee0e101518abff7cc33d2601e1 /searx/engines/startpage.py
parentea414c65745b69695f89c923f46a77553a3303fe (diff)
downloadsearxng-111a86d355fe2fcbc714a478cb399ef47b79ec35.tar.gz
searxng-111a86d355fe2fcbc714a478cb399ef47b79ec35.zip
[fix] html escape
Diffstat (limited to 'searx/engines/startpage.py')
-rw-r--r--searx/engines/startpage.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index f5a652317..8d44d05ab 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -1,5 +1,6 @@
from urllib import urlencode
from lxml import html
+from cgi import escape
base_url = None
search_url = None
@@ -35,11 +36,11 @@ def response(resp):
if url.startswith('http://www.google.')\
or url.startswith('https://www.google.'):
continue
- title = link.text_content()
+ title = escape(link.text_content())
content = ''
if result.xpath('./p[@class="desc"]'):
- content = result.xpath('./p[@class="desc"]')[0].text_content()
+ content = escape(result.xpath('./p[@class="desc"]')[0].text_content())
results.append({'url': url, 'title': title, 'content': content})