正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
| @@ -68,7 +68,10 @@ class Body { | @@ -68,7 +68,10 @@ class Body { | ||
| 68 | */ | 68 | */ |
| 69 | private function parseBoundaryBody(string $body, string $boundary){ | 69 | private function parseBoundaryBody(string $body, string $boundary){ |
| 70 | // 切割成块 boundary 的结束符号 前后都会多2个-- | 70 | // 切割成块 boundary 的结束符号 前后都会多2个-- |
| 71 | - $items = explode($boundary, | 71 | + // 为什么要加 \r\n在签名进行切割呢 是因为 boundary分割符只会占单独的一行, |
| 72 | + //有一些服务商会把header头一起返回,header里面包含了这个符号, | ||
| 73 | + //如果不加\r\n 就会导致 切割异常 | ||
| 74 | + $items = explode("\r\n".$boundary, | ||
| 72 | str_replace(['--'.$boundary.'--', $boundary.'--','--'.$boundary],$boundary,$body) | 75 | str_replace(['--'.$boundary.'--', $boundary.'--','--'.$boundary],$boundary,$body) |
| 73 | ); | 76 | ); |
| 74 | // 第一个块和最后一块 是没用的块 | 77 | // 第一个块和最后一块 是没用的块 |
| @@ -167,6 +170,7 @@ class Body { | @@ -167,6 +170,7 @@ class Body { | ||
| 167 | break; | 170 | break; |
| 168 | } | 171 | } |
| 169 | case '8bit':{ | 172 | case '8bit':{ |
| 173 | + $data->body = mb_decode_mimeheader($data->body); | ||
| 170 | break; | 174 | break; |
| 171 | } | 175 | } |
| 172 | } | 176 | } |
-
请 注册 或 登录 后发表评论