From bfc85248762399f30b6ffdadc2f8ff8897c4f27e Mon Sep 17 00:00:00 2001 From: djmaze <> Date: Thu, 6 Jan 2022 16:20:24 +0100 Subject: [PATCH] Improved aAttrsForRemove handling --- .../v/0.0.0/app/libraries/MailSo/Base/HtmlUtils.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Base/HtmlUtils.php b/snappymail/v/0.0.0/app/libraries/MailSo/Base/HtmlUtils.php index 94a6fa4c8..3ef9846b7 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Base/HtmlUtils.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Base/HtmlUtils.php @@ -513,8 +513,7 @@ abstract class HtmlUtils else if ('table' === $sTagNameLower && $oElement->hasAttribute('width')) { - @$oElement->removeAttribute('width'); - $aAttrsForRemove['width'] = true; + $aAttrsForRemove[] = 'width'; } if ($oElement->hasAttributes() && isset($oElement->attributes) && $oElement->attributes) @@ -538,7 +537,7 @@ abstract class HtmlUtils 'fscommand', 'seeksegmenttime' ))) { - $aAttrsForRemove[$sName] = true; + $aAttrsForRemove[] = $sAttrName; } } } @@ -705,12 +704,7 @@ abstract class HtmlUtils if (\MailSo\Config::$HtmlStrictDebug && $aAttrsForRemove) { - unset($aAttrsForRemove['class'], $aAttrsForRemove['target'], $aAttrsForRemove['id'], $aAttrsForRemove['name'], - $aAttrsForRemove['itemprop'], $aAttrsForRemove['itemscope'], $aAttrsForRemove['itemtype']); - if ($aAttrsForRemove) - { - $oElement->setAttribute('data-removed-attrs', \implode(',', \array_keys($aAttrsForRemove))); - } + $oElement->setAttribute('data-removed-attrs', \implode(',', $aAttrsForRemove)); } }