mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
* Mail: check non-utf8 body, if it might be utf-8, to display readable
This commit is contained in:
parent
832f105982
commit
be212f908c
@ -3339,9 +3339,17 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
|
|||||||
|
|
||||||
if(($singleBodyPart['mimeType'] == 'text/html' || $singleBodyPart['mimeType'] == 'text/plain') &&
|
if(($singleBodyPart['mimeType'] == 'text/html' || $singleBodyPart['mimeType'] == 'text/plain') &&
|
||||||
strtoupper($singleBodyPart['charSet']) != 'UTF-8')
|
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']);
|
$singleBodyPart['body'] = preg_replace($sar,$rar,$singleBodyPart['body']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//error_log(__METHOD__.__LINE__.'reports:'.$singleBodyPart['charSet']);
|
//error_log(__METHOD__.__LINE__.'reports:'.$singleBodyPart['charSet']);
|
||||||
if ($singleBodyPart['charSet']=='us-ascii')
|
if ($singleBodyPart['charSet']=='us-ascii')
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user