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 7ec116d64..65e782f10 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 @@ -45,9 +45,29 @@ abstract class HtmlUtils $bState = \libxml_use_internal_errors(true); } + $sText = \str_replace('', '', $sText); + $sText = \str_replace('', '', $sText); + $sText = \str_replace('', '', $sText); +// $sText = \preg_replace('##s', '', $sText); + + // https://github.com/the-djmaze/snappymail/issues/187 + $sText = \preg_replace('#]*>(((?! 1, + 'join-classes' => 1, + 'newline' => 'LF', + 'numeric-entities' => 1, + 'quote-nbsp' => 0, + 'word-2000' => 1 + ); + $sText = \tidy_repair_string($sText, $tidyConfig, 'utf8'); + } + $sHtmlAttrs = $sBodyAttrs = ''; - $sText = static::FixSchemas($sText); $sText = static::ClearFastTags($sText); $sText = static::ClearBodyAndHtmlTag($sText, $sHtmlAttrs, $sBodyAttrs); @@ -178,19 +198,6 @@ abstract class HtmlUtils return $sHtml; } - private static function FixSchemas(string $sHtml, bool $bClearEmpty = true) : string - { - if ($bClearEmpty) - { - $sHtml = \str_replace('', '', $sHtml); - } - - $sHtml = \str_replace('', '', $sHtml); - $sHtml = \str_replace('', '', $sHtml); - - return $sHtml; - } - private static function ClearFastTags(string $sHtml) : string { return \preg_replace(array(