No need to check for libxml_use_internal_errors

This commit is contained in:
the-djmaze 2023-11-22 12:52:56 +01:00
parent 288eedf6a1
commit 0dfcc52728

View file

@ -22,10 +22,7 @@ abstract class HtmlUtils
*/ */
public static function BuildHtml(string $sHtml, array &$aFoundCids, array &$aFoundDataURL, array &$aFoundContentLocationUrls) : string public static function BuildHtml(string $sHtml, array &$aFoundCids, array &$aFoundDataURL, array &$aFoundContentLocationUrls) : string
{ {
$bState = true; $bState = \libxml_use_internal_errors(true);
if (\MailSo\Base\Utils::FunctionCallable('libxml_use_internal_errors')) {
$bState = \libxml_use_internal_errors(true);
}
$sHtml = \str_replace('<o:p></o:p>', '', $sHtml); $sHtml = \str_replace('<o:p></o:p>', '', $sHtml);
$sHtml = \str_replace('<o:p>', '<span>', $sHtml); $sHtml = \str_replace('<o:p>', '<span>', $sHtml);
@ -89,9 +86,7 @@ abstract class HtmlUtils
\libxml_clear_errors(); \libxml_clear_errors();
} }
if (\MailSo\Base\Utils::FunctionCallable('libxml_use_internal_errors')) { \libxml_use_internal_errors($bState);
\libxml_use_internal_errors($bState);
}
$sHtml = ''; $sHtml = '';
$oBody = $oDoc->getElementsByTagName('body')->item(0); $oBody = $oDoc->getElementsByTagName('body')->item(0);