Fix iteration bug while removing attributes

This commit is contained in:
2019-10-21 17:53:44 +02:00
parent 422ed5b4e6
commit 228be9f4be

View File

@@ -87,6 +87,7 @@ class EMailNotification(BaseNotification):
"border", "border",
"cellpadding", "cellpadding",
"cellspacing", "cellspacing",
"class",
"color", "color",
"colspan", "colspan",
"dir", "dir",
@@ -247,7 +248,7 @@ class EMailNotification(BaseNotification):
# remove not whitelisted attributes # remove not whitelisted attributes
for element in soup.find_all(True): 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 attribute not in EMailNotification.good_attributes:
if element.name == "a" and attribute == "href": if element.name == "a" and attribute == "href":
self.logger.debug( self.logger.debug(