mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-25 07:16:21 +08:00
Improved message html loading
This commit is contained in:
parent
6d7911a9ed
commit
24d3f080b2
1 changed files with 3 additions and 6 deletions
|
@ -55,7 +55,7 @@ abstract class HtmlUtils
|
||||||
$sText = static::ClearBodyAndHtmlTag($sText, $sHtmlAttrs, $sBodyAttrs);
|
$sText = static::ClearBodyAndHtmlTag($sText, $sHtmlAttrs, $sBodyAttrs);
|
||||||
|
|
||||||
$oDom = self::createDOMDocument();
|
$oDom = self::createDOMDocument();
|
||||||
$oDom->loadHTML('<?xml version="1.0" encoding="utf-8"?>'.
|
@$oDom->loadHTML('<?xml version="1.0" encoding="utf-8"?>'.
|
||||||
'<html '.$sHtmlAttrs.'><head>'.
|
'<html '.$sHtmlAttrs.'><head>'.
|
||||||
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>'.
|
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>'.
|
||||||
'<body '.$sBodyAttrs.'>'.\MailSo\Base\Utils::Utf8Clear($sText).'</body></html>');
|
'<body '.$sBodyAttrs.'>'.\MailSo\Base\Utils::Utf8Clear($sText).'</body></html>');
|
||||||
|
@ -165,11 +165,8 @@ abstract class HtmlUtils
|
||||||
$sBodyAttrs = $aMatch[1];
|
$sBodyAttrs = $aMatch[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
$sHtml = \preg_replace('/<head([^>]*)>/si', '', $sHtml);
|
// $sHtml = \preg_replace('/^.*<body([^>]*)>/si', '', $sHtml);
|
||||||
$sHtml = \preg_replace('/<body([^>]*)>/si', '', $sHtml);
|
$sHtml = \preg_replace('/<\/?(head|body|html|meta)(\\s[^>]*)?>/si', '', $sHtml);
|
||||||
$sHtml = \preg_replace('/<\/body>/i', '', $sHtml);
|
|
||||||
$sHtml = \preg_replace('/<html([^>]*)>/i', '', $sHtml);
|
|
||||||
$sHtml = \preg_replace('/<\/html>/i', '', $sHtml);
|
|
||||||
|
|
||||||
$sHtmlAttrs = \preg_replace('/xmlns:[a-z]="[^"]*"/i', '', $sHtmlAttrs);
|
$sHtmlAttrs = \preg_replace('/xmlns:[a-z]="[^"]*"/i', '', $sHtmlAttrs);
|
||||||
$sHtmlAttrs = \preg_replace('/xmlns:[a-z]=\'[^\']*\'/i', '', $sHtmlAttrs);
|
$sHtmlAttrs = \preg_replace('/xmlns:[a-z]=\'[^\']*\'/i', '', $sHtmlAttrs);
|
||||||
|
|
Loading…
Reference in a new issue