completely preserve html as given when requested

This commit is contained in:
Klaus Leithoff 2015-10-23 13:56:25 +00:00
parent d39330abe3
commit c96daf2482

View File

@ -4707,6 +4707,8 @@ class emailadmin_imapbase
$mailClass->activeMimeType = 'text/plain'; $mailClass->activeMimeType = 'text/plain';
if ($bodyParts[$i]['mimeType'] == 'text/html') { if ($bodyParts[$i]['mimeType'] == 'text/html') {
$mailClass->activeMimeType = $bodyParts[$i]['mimeType']; $mailClass->activeMimeType = $bodyParts[$i]['mimeType'];
if (!$preserveHTML)
{
// as translation::convert reduces \r\n to \n and purifier eats \n -> peplace it with a single space // as translation::convert reduces \r\n to \n and purifier eats \n -> peplace it with a single space
$newBody = str_replace("\n"," ",$newBody); $newBody = str_replace("\n"," ",$newBody);
// convert HTML to text, as we dont want HTML in infologs // convert HTML to text, as we dont want HTML in infologs
@ -4757,6 +4759,7 @@ class emailadmin_imapbase
$mailClass->getCleanHTML($newBody); // remove stuff we regard as unwanted $mailClass->getCleanHTML($newBody); // remove stuff we regard as unwanted
if ($preserveHTML==false) $newBody = str_replace("<br />","\r\n",$newBody); if ($preserveHTML==false) $newBody = str_replace("<br />","\r\n",$newBody);
//error_log(__METHOD__.' ('.__LINE__.') '.' after getClean:'.$newBody); //error_log(__METHOD__.' ('.__LINE__.') '.' after getClean:'.$newBody);
}
$message .= $newBody; $message .= $newBody;
continue; continue;
} }