...
|
...
|
@@ -292,20 +292,25 @@ class Header{ |
|
|
public static function mime_decode(string $str):string {
|
|
|
|
|
|
$str = trim($str);
|
|
|
if(preg_match("/^=\?([a-z0-9-.]{3,})\?[bq]\?/i",$str,$code)){
|
|
|
$str = explode("\r\n",$str);
|
|
|
foreach ($str as $k=>$s){
|
|
|
$s = trim($s);
|
|
|
if(preg_match("/^=\?([a-z0-9-.]{3,})\?[bq]\?/i",$s,$code)){
|
|
|
// 解码 这个函数好像已经转码了,
|
|
|
// iso-8859-8-i php 好像没有这个编码 ,阿拉伯 iso-8859-8
|
|
|
// =?iso-8859-8-i?B?4eTu+eog7PTw6en66iDg7CDn4fj6IERjb20gLSD08OnkIO7xIDgyNzUz?=
|
|
|
$str = str_replace("=?{$code[1]}?",'=?'.Fun::getEncodingAliases($code[1]).'?',$str);
|
|
|
$s = str_replace("=?{$code[1]}?",'=?'.Fun::getEncodingAliases($code[1]).'?',$s);
|
|
|
|
|
|
$str = mb_decode_mimeheader($str);
|
|
|
$s = mb_decode_mimeheader($s);
|
|
|
|
|
|
return $str;
|
|
|
$str[$k] = $s;
|
|
|
// 转字符编码
|
|
|
// return mb_convert_encoding($str,'utf-8',$code[1]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
return $str;
|
|
|
return implode(" ",$str);
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|