mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
improving decode_header for charset x-unknown and encoding Base64
This commit is contained in:
parent
51f0999141
commit
ae9c0bc918
@ -953,13 +953,21 @@ class translation
|
||||
$string = preg_replace('/\?=\s+=\?/', '?= =?', $_string);
|
||||
|
||||
$elements=imap_mime_header_decode($string);
|
||||
|
||||
$convertAtEnd = false;
|
||||
foreach((array)$elements as $element)
|
||||
{
|
||||
if ($element->charset == 'default') $element->charset = 'iso-8859-1';
|
||||
|
||||
if ($element->charset != 'x-unknown')
|
||||
{
|
||||
$newString .= self::convert($element->text,$element->charset);
|
||||
}
|
||||
else
|
||||
{
|
||||
$newString .= $element->text;
|
||||
$convertAtEnd = true;
|
||||
}
|
||||
}
|
||||
if ($convertAtEnd) $newString = self::decodeMailHeader($newString,$displayCharset);
|
||||
return preg_replace('/([\000-\012\015\016\020-\037\075])/','',$newString);
|
||||
}
|
||||
elseif(function_exists(mb_decode_mimeheader))
|
||||
|
Loading…
Reference in New Issue
Block a user