From f6e77c67bfbcb46d4bd2524952f3970cac1f0849 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 11 Jan 2021 21:58:24 -0600 Subject: [PATCH] Escape XML for problems and comments --- judge/feed.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/judge/feed.py b/judge/feed.py index ebb2f5f..6d8d825 100644 --- a/judge/feed.py +++ b/judge/feed.py @@ -33,6 +33,7 @@ class ProblemFeed(Feed): desc = cache.get(key) if desc is None: desc = str(markdown(problem.description, 'problem'))[:500] + '...' + desc = escape_xml_illegal_chars(desc) cache.set(key, desc, 86400) return desc @@ -63,6 +64,7 @@ class CommentFeed(Feed): desc = cache.get(key) if desc is None: desc = str(markdown(comment.body, 'comment')) + desc = escape_xml_illegal_chars(desc) cache.set(key, desc, 86400) return desc