@@ -330,25 +330,12 @@ function _decode($headers, $body, $default_ctype = 'text/plain')
330
330
if (isset ($ content_type )) {
331
331
switch (strtolower ($ content_type ['value ' ])) {
332
332
case 'text/plain ' :
333
- $ encoding = isset ($ content_transfer_encoding ) ? $ content_transfer_encoding ['value ' ] : '7bit ' ;
334
- $ charset = isset ($ return ->ctype_parameters ['charset ' ]) ? $ return ->ctype_parameters ['charset ' ] : $ this ->_charset ;
335
- $ this ->_include_bodies ? $ return ->body = ($ this ->_decode_bodies ? $ this ->_decodeBody ($ body , $ encoding , $ charset , true ) : $ body ) : null ;
336
- break ;
337
-
338
333
case 'text/html ' :
339
334
$ encoding = isset ($ content_transfer_encoding ) ? $ content_transfer_encoding ['value ' ] : '7bit ' ;
340
335
$ charset = isset ($ return ->ctype_parameters ['charset ' ]) ? $ return ->ctype_parameters ['charset ' ] : $ this ->_charset ;
341
336
$ this ->_include_bodies ? $ return ->body = ($ this ->_decode_bodies ? $ this ->_decodeBody ($ body , $ encoding , $ charset , true ) : $ body ) : null ;
342
337
break ;
343
-
344
- case 'multipart/signed ' : // PGP
345
- $ parts = $ this ->_boundarySplit ($ body , $ content_type ['other ' ]['boundary ' ], true );
346
- $ return ->parts ['msg_body ' ] = $ parts [0 ];
347
- list ($ part_header , $ part_body ) = $ this ->_splitBodyHeader ($ parts [1 ]);
348
- $ return ->parts ['sig_hdr ' ] = $ part_header ;
349
- $ return ->parts ['sig_body ' ] = $ part_body ;
350
- break ;
351
-
338
+
352
339
case 'multipart/encrypted ' : // #190 encrypted parts will be treated as normal ones
353
340
case 'multipart/parallel ' :
354
341
case 'multipart/appledouble ' : // Appledouble mail
@@ -367,7 +354,7 @@ function _decode($headers, $body, $default_ctype = 'text/plain')
367
354
368
355
$ default_ctype = (strtolower ($ content_type ['value ' ]) === 'multipart/digest ' ) ? 'message/rfc822 ' : 'text/plain ' ;
369
356
370
- $ parts = $ this ->_boundarySplit ($ body , $ content_type ['other ' ]['boundary ' ]);
357
+ $ parts = $ this ->_boundarySplit ($ body , $ content_type ['other ' ]['boundary ' ], strtolower ( $ content_type [ ' value ' ]) === ' multipart/signed ' );
371
358
for ($ i = 0 ; $ i < count ($ parts ); $ i ++) {
372
359
list ($ part_header , $ part_body ) = $ this ->_splitBodyHeader ($ parts [$ i ]);
373
360
$ part = $ this ->_decode ($ part_header , $ part_body , $ default_ctype );
0 commit comments