正在显示
1 个修改的文件
包含
12 行增加
和
7 行删除
| @@ -292,20 +292,25 @@ class Header{ | @@ -292,20 +292,25 @@ class Header{ | ||
| 292 | public static function mime_decode(string $str):string { | 292 | public static function mime_decode(string $str):string { | 
| 293 | 293 | ||
| 294 | $str = trim($str); | 294 | $str = trim($str); | 
| 295 | - if(preg_match("/^=\?([a-z0-9-.]{3,})\?[bq]\?/i",$str,$code)){ | ||
| 296 | - // 解码 这个函数好像已经转码了, | 295 | + $str = explode("\r\n",$str); | 
| 296 | + foreach ($str as $k=>$s){ | ||
| 297 | + $s = trim($s); | ||
| 298 | + if(preg_match("/^=\?([a-z0-9-.]{3,})\?[bq]\?/i",$s,$code)){ | ||
| 299 | + // 解码 这个函数好像已经转码了, | ||
| 297 | // iso-8859-8-i php 好像没有这个编码 ,阿拉伯 iso-8859-8 | 300 | // iso-8859-8-i php 好像没有这个编码 ,阿拉伯 iso-8859-8 | 
| 298 | // =?iso-8859-8-i?B?4eTu+eog7PTw6en66iDg7CDn4fj6IERjb20gLSD08OnkIO7xIDgyNzUz?= | 301 | // =?iso-8859-8-i?B?4eTu+eog7PTw6en66iDg7CDn4fj6IERjb20gLSD08OnkIO7xIDgyNzUz?= | 
| 299 | - $str = str_replace("=?{$code[1]}?",'=?'.Fun::getEncodingAliases($code[1]).'?',$str); | 302 | + $s = str_replace("=?{$code[1]}?",'=?'.Fun::getEncodingAliases($code[1]).'?',$s); | 
| 300 | 303 | ||
| 301 | - $str = mb_decode_mimeheader($str); | 304 | + $s = mb_decode_mimeheader($s); | 
| 302 | 305 | ||
| 303 | - return $str; | ||
| 304 | - // 转字符编码 | 306 | + $str[$k] = $s; | 
| 307 | + // 转字符编码 | ||
| 305 | // return mb_convert_encoding($str,'utf-8',$code[1]); | 308 | // return mb_convert_encoding($str,'utf-8',$code[1]); | 
| 309 | + } | ||
| 306 | } | 310 | } | 
| 307 | 311 | ||
| 308 | - return $str; | 312 | + | 
| 313 | + return implode(" ",$str); | ||
| 309 | } | 314 | } | 
| 310 | 315 | ||
| 311 | 316 | 
- 
请 注册 或 登录 后发表评论