diff --git a/felamimail/inc/class.bofelamimail.inc.php b/felamimail/inc/class.bofelamimail.inc.php index 592158b96d..51286d1153 100644 --- a/felamimail/inc/class.bofelamimail.inc.php +++ b/felamimail/inc/class.bofelamimail.inc.php @@ -413,8 +413,8 @@ switch ($_encoding) { case 'BASE64': - // use imap_base64 to decode - return imap_base64($_mimeMessage); + // use imap_base64 to decode, not any longer, as it is strict, and fails if it encounters invalid chars + return base64_decode($_mimeMessage); //imap_base64($_mimeMessage); break; case 'QUOTED-PRINTABLE': // use imap_qprint to decode diff --git a/felamimail/inc/class.uidisplay.inc.php b/felamimail/inc/class.uidisplay.inc.php index ad8f3e381b..18ea025b8b 100644 --- a/felamimail/inc/class.uidisplay.inc.php +++ b/felamimail/inc/class.uidisplay.inc.php @@ -1082,9 +1082,11 @@ if($singleBodyPart['mimeType'] == 'text/plain') { - $newBody = $singleBodyPart['body']; + //$newBody = $singleBodyPart['body']; $newBody = @htmlentities($singleBodyPart['body'],ENT_QUOTES, strtoupper($this->displayCharset)); + // if empty and charset is utf8 try sanitizing the string in question + if (empty($newBody) && strtolower($singleBodyPart['charSet'])=='utf-8') $newBody = @htmlentities(iconv('utf-8', 'utf-8', $singleBodyPart['body']),ENT_QUOTES, strtoupper($this->displayCharset)); // if the conversion to htmlentities fails somehow, try without specifying the charset, which defaults to iso- if (empty($newBody)) $newBody = htmlentities($singleBodyPart['body'],ENT_QUOTES); #$newBody = $this->bofelamimail->wordwrap($newBody, 90, "\n");