From 228be9f4be0f99e825cbc75db22a175fd337afde Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Mon, 21 Oct 2019 17:53:44 +0200 Subject: [PATCH] Fix iteration bug while removing attributes --- pyquarantine/notifications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyquarantine/notifications.py b/pyquarantine/notifications.py index 7baa2dc..e67895b 100644 --- a/pyquarantine/notifications.py +++ b/pyquarantine/notifications.py @@ -87,6 +87,7 @@ class EMailNotification(BaseNotification): "border", "cellpadding", "cellspacing", + "class", "color", "colspan", "dir", @@ -247,7 +248,7 @@ class EMailNotification(BaseNotification): # remove not whitelisted attributes for element in soup.find_all(True): - for attribute in element.attrs.keys(): + for attribute in list(element.attrs.keys()): if attribute not in EMailNotification.good_attributes: if element.name == "a" and attribute == "href": self.logger.debug(