* Mail: check non-utf8 body, if it might be utf-8, to display readable

This commit is contained in:
Ralf Becker 2019-03-29 16:50:33 +01:00
parent 832f105982
commit be212f908c

View File

@ -3339,9 +3339,17 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
if(($singleBodyPart['mimeType'] == 'text/html' || $singleBodyPart['mimeType'] == 'text/plain') &&
strtoupper($singleBodyPart['charSet']) != 'UTF-8')
{
// check if client set a wrong charset and content is utf-8 --> use utf-8
if (preg_match('//u', $singleBodyPart['body']))
{
$singleBodyPart['charSet'] = 'UTF-8';
}
else
{
$singleBodyPart['body'] = preg_replace($sar,$rar,$singleBodyPart['body']);
}
}
//error_log(__METHOD__.__LINE__.'reports:'.$singleBodyPart['charSet']);
if ($singleBodyPart['charSet']=='us-ascii')
{