From 472c0c115fc76c4e22bd966ed478f28dbb0b2e43 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Sun, 9 Jul 2023 20:26:32 +0800 Subject: [PATCH] Fix Bug 541 --- app/admin_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/admin_service.py b/app/admin_service.py index 5ca93c2..57f5e38 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -56,9 +56,9 @@ def article(): _articles = get_page_articles(_cur_page, _page_size) for article in _articles: # 获取每篇文章的title - article = escape(article) - article.title = article.text.split("\n")[0] - article.content = '
'.join(article.text.split("\n")[1:]) + text = escape(article.text) # Fix XSS vulnerability, contributed by Xu Xuan + article.title = text.split("\n")[0] + article.content = '
'.join(text.split("\n")[1:]) context = { "article_number": _article_number,