From 724f1cecccfe1115032dce2525a1392eaabf9cf1 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 12 Mar 2018 13:17:41 +0000 Subject: [PATCH] Added xmpp as an acceptable protocol in links when sanitizing. - Legacy-Id: 14766 --- ietf/utils/html.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ietf/utils/html.py b/ietf/utils/html.py index 5fb74bbab..acf8106b2 100644 --- a/ietf/utils/html.py +++ b/ietf/utils/html.py @@ -18,6 +18,8 @@ acceptable_tags = ('a', 'abbr', 'acronym', 'address', 'b', 'big', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var') +acceptable_protocols = ['http', 'https', 'mailto', 'xmpp', ] + strip_completely = ['style', 'script', ] class StripFilter(Filter): @@ -33,7 +35,7 @@ class StripFilter(Filter): # Leave the stripping of the strip_completely tags to StripFilter bleach_tags = list(set(acceptable_tags) | set(strip_completely)) -cleaner = bleach.sanitizer.Cleaner(tags=bleach_tags, filters=[StripFilter], strip=True) +cleaner = bleach.sanitizer.Cleaner(tags=bleach_tags, protocols=acceptable_protocols, filters=[StripFilter], strip=True) def unescape(text): """