浏览代码

[fix] description escaping

asciimoo 11 年前
父节点
当前提交
9bd4459638
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      searx/engines/github.py

+ 2
- 1
searx/engines/github.py 查看文件

@@ -1,5 +1,6 @@
1 1
 from urllib import urlencode
2 2
 from json import loads
3
+from cgi import escape
3 4
 
4 5
 categories = ['it']
5 6
 
@@ -20,6 +21,6 @@ def response(resp):
20 21
     for res in search_res['items']:
21 22
         title = res['name']
22 23
         url = res['html_url']
23
-        content = res['description']
24
+        content = escape(res['description'][:500])
24 25
         results.append({'url': url, 'title': title, 'content': content})
25 26
     return results