From e4757eba1ad070efda7da778933596edb5f202b3 Mon Sep 17 00:00:00 2001 From: Charmander <~@charmander.me> Date: Thu, 21 Feb 2019 03:08:27 +0000 Subject: [PATCH] =?UTF-8?q?Allow=20data:=20to=20not=20be=20part=20of=20san?= =?UTF-8?q?itizer=E2=80=99s=20allowed=20protocols?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When `data:` wasn’t permitted, it could attempt to `del attrs[attr]` twice. --- html5lib/filters/sanitizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html5lib/filters/sanitizer.py b/html5lib/filters/sanitizer.py index e852f53b..ce67b7de 100644 --- a/html5lib/filters/sanitizer.py +++ b/html5lib/filters/sanitizer.py @@ -825,7 +825,7 @@ def allowed_token(self, token): if uri and uri.scheme: if uri.scheme not in self.allowed_protocols: del attrs[attr] - if uri.scheme == 'data': + elif uri.scheme == 'data': m = data_content_type.match(uri.path) if not m: del attrs[attr]
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: