on master help sign in
[fix] html escape
commit111a86d355fe2fcbc714a478cb399ef47b79ec35 authorAdam Tauber <asciimoo@gmail.com> dateWed 6 Aug 2014, 14:43 (12 years ago) parentea414c6
1 file changed+3−2
searx/engines/startpage.py+3−2
searx/engines/startpage.py+3−2
@@ -1,5 +1,6 @@
11from urllib import urlencode
22from lxml import html
3+from cgi import escape
34
45base_url = None
56search_url = None
@@ -35,11 +36,11 @@ def response(resp):
3536 if url.startswith('http://www.google.')\
3637 or url.startswith('https://www.google.'):
3738 continue
38− title = link.text_content()
39+ title = escape(link.text_content())
3940
4041 content = ''
4142 if result.xpath('./p[@class="desc"]'):
42− content = result.xpath('./p[@class="desc"]')[0].text_content()
43+ content = escape(result.xpath('./p[@class="desc"]')[0].text_content())
4344
4445 results.append({'url': url, 'title': title, 'content': content})
4546