From 1cf7344ef5043638a8ac6466a51198149261a5f6 Mon Sep 17 00:00:00 2001 From: djmaze Date: Fri, 18 Dec 2020 11:11:54 +0100 Subject: [PATCH] Prepare \MailSo\Base\HtmlUtils::ClearHtml for improvements --- .../0.0.0/app/libraries/MailSo/Base/HtmlUtils.php | 14 +++++++------- snappymail/v/0.0.0/app/libraries/RainLoop/Api.php | 6 +++--- 2 files changed, 10 insertions(+), 10 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 6d35b4ea9..5b9990d03 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 @@ -680,11 +680,11 @@ abstract class HtmlUtils if ($sAttrName && $oAttr) { $sAttrNameLower = \trim(\strtolower($sAttrName)); - if ($aHtmlAllowedAttributes && !\in_array($sAttrNameLower, $aHtmlAllowedAttributes)) - { - $sAttrsForRemove[] = $sAttrName; - } - else if ('on' === \substr($sAttrNameLower, 0, 2) || in_array($sAttrNameLower, array( + if (($aHtmlAllowedAttributes && !\in_array($sAttrNameLower, $aHtmlAllowedAttributes)) + || 'on' === \substr($sAttrNameLower, 0, 2) +// || 'data-' === \substr($sAttrNameLower, 0, 5) +// || \strpos($sAttrNameLower, ':') + || \in_array($sAttrNameLower, array( 'id', 'class', 'contenteditable', 'designmode', 'formaction', 'manifest', 'action', 'data-bind', 'data-reactid', 'xmlns', 'srcset', 'data-x-skip-style', 'fscommand', 'seeksegmenttime' @@ -756,8 +756,8 @@ abstract class HtmlUtils $sH = $oElement->hasAttribute('height') ? \trim($oElement->getAttribute('height')) : ''; -// $sW = $oElement->hasAttribute('width') -// ? \trim($oElement->getAttribute('width')) : ''; +// $sW = $oElement->hasAttribute('width') +// ? \trim($oElement->getAttribute('width')) : ''; $sStyles = $oElement->hasAttribute('style') ? \preg_replace('/[\s]+/', '', \trim(\trim(\trim($oElement->getAttribute('style')), ';'))) : ''; diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php index 211635520..8eec86cf5 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php @@ -112,8 +112,6 @@ class Api if (static::Config()->Get('labs', 'strict_html_parser', true)) { \MailSo\Config::$HtmlStrictAllowedAttributes = array( - // rainloop - 'data-wrp', // defaults 'name', 'dir', 'lang', 'style', 'title', @@ -148,8 +146,10 @@ class Api 'selected', 'label', // table 'cols', 'rows', 'frame', 'rules', 'summary', 'cellpadding', 'cellspacing', + // th + 'abbr', 'scope', // td - 'abbr', 'axis', 'colspan', 'rowspan', 'headers', 'nowrap' + 'axis', 'colspan', 'rowspan', 'headers', 'nowrap' ); } }