forked from extern/egroupware
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);
|
$string = preg_replace('/\?=\s+=\?/', '?= =?', $_string);
|
||||||
|
|
||||||
$elements=imap_mime_header_decode($string);
|
$elements=imap_mime_header_decode($string);
|
||||||
|
$convertAtEnd = false;
|
||||||
foreach((array)$elements as $element)
|
foreach((array)$elements as $element)
|
||||||
{
|
{
|
||||||
if ($element->charset == 'default') $element->charset = 'iso-8859-1';
|
if ($element->charset == 'default') $element->charset = 'iso-8859-1';
|
||||||
|
if ($element->charset != 'x-unknown')
|
||||||
|
{
|
||||||
$newString .= self::convert($element->text,$element->charset);
|
$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);
|
return preg_replace('/([\000-\012\015\016\020-\037\075])/','',$newString);
|
||||||
}
|
}
|
||||||
elseif(function_exists(mb_decode_mimeheader))
|
elseif(function_exists(mb_decode_mimeheader))
|
||||||
|
Loading…
Reference in New Issue
Block a user