mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-05 21:49:28 +01:00
fixing a problem regarding the viewing of mails created by MSExchange that seem to contain invalid chars in BASE64 encoded string AND invalid encoding for UTF8
This commit is contained in:
parent
3a5e270948
commit
781048414b
@ -376,8 +376,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
|
||||
|
@ -1038,9 +1038,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");
|
||||
|
Loading…
Reference in New Issue
Block a user