Fix Bug 541

Bug511-Bosh
Lan Hui 2023-07-09 20:26:32 +08:00
parent 9a156ebf7e
commit 472c0c115f
1 changed files with 3 additions and 3 deletions

View File

@ -56,9 +56,9 @@ def article():
_articles = get_page_articles(_cur_page, _page_size) _articles = get_page_articles(_cur_page, _page_size)
for article in _articles: # 获取每篇文章的title for article in _articles: # 获取每篇文章的title
article = escape(article) text = escape(article.text) # Fix XSS vulnerability, contributed by Xu Xuan
article.title = article.text.split("\n")[0] article.title = text.split("\n")[0]
article.content = '<br/>'.join(article.text.split("\n")[1:]) article.content = '<br/>'.join(text.split("\n")[1:])
context = { context = {
"article_number": _article_number, "article_number": _article_number,