mirror of
https://github.com/searxng/searxng.git
synced 2025-07-23 05:09:17 +02:00
[fix] swisscow and yandex escaping - fixes #499
This commit is contained in:
parent
c61ea820d2
commit
e061c6e059
2 changed files with 8 additions and 6 deletions
|
@ -10,6 +10,7 @@
|
|||
@parse url, title, content
|
||||
"""
|
||||
|
||||
from cgi import escape
|
||||
from json import loads
|
||||
from urllib import urlencode, unquote
|
||||
import re
|
||||
|
@ -77,7 +78,7 @@ def response(resp):
|
|||
|
||||
# append result
|
||||
results.append({'url': result['SourceUrl'],
|
||||
'title': result['Title'],
|
||||
'title': escape(result['Title']),
|
||||
'content': '',
|
||||
'img_src': img_url,
|
||||
'template': 'images.html'})
|
||||
|
@ -89,8 +90,8 @@ def response(resp):
|
|||
|
||||
# append result
|
||||
results.append({'url': result_url,
|
||||
'title': result_title,
|
||||
'content': result_content})
|
||||
'title': escape(result_title),
|
||||
'content': escape(result_content)})
|
||||
|
||||
# parse images
|
||||
for result in json.get('Images', []):
|
||||
|
@ -99,7 +100,7 @@ def response(resp):
|
|||
|
||||
# append result
|
||||
results.append({'url': result['SourceUrl'],
|
||||
'title': result['Title'],
|
||||
'title': escape(result['Title']),
|
||||
'content': '',
|
||||
'img_src': img_url,
|
||||
'template': 'images.html'})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue