@@ -2232,40 +2232,43 @@ protected function structure_part($part, $count = 0, $parent = '', $mime_headers
2232
2232
2233
2233
// fetch message headers if message/rfc822 or named part (could contain Content-Location header)
2234
2234
if (
2235
- $ struct ->ctype_primary == 'message '
2236
- || (!empty ($ struct ->ctype_parameters ['name ' ]) && !empty ($ struct ->content_id ))
2235
+ empty ($ mime_headers )
2236
+ && (
2237
+ $ struct ->ctype_primary == 'message '
2238
+ || (!empty ($ struct ->ctype_parameters ['name ' ]) && !empty ($ struct ->content_id ))
2239
+ )
2237
2240
) {
2238
- if (empty ($ mime_headers )) {
2239
- $ mime_headers = $ this ->conn ->fetchPartHeader ($ this ->folder , $ this ->msg_uid , true , $ struct ->mime_id );
2240
- }
2241
+ $ mime_headers = $ this ->conn ->fetchPartHeader ($ this ->folder , $ this ->msg_uid , true , $ struct ->mime_id );
2242
+ }
2241
2243
2244
+ if (!empty ($ mime_headers )) {
2242
2245
if (is_string ($ mime_headers )) {
2243
2246
$ struct ->headers = rcube_mime::parse_headers ($ mime_headers ) + $ struct ->headers ;
2244
2247
} elseif (is_object ($ mime_headers )) {
2245
2248
$ struct ->headers = get_object_vars ($ mime_headers ) + $ struct ->headers ;
2246
2249
}
2250
+ }
2247
2251
2248
- // get real content-type of message/rfc822
2249
- if ($ struct ->mimetype == 'message/rfc822 ' ) {
2250
- // single-part
2251
- if (!is_array ($ part [8 ][0 ]) && !is_array ($ part [8 ][1 ])) {
2252
- $ struct ->real_mimetype = strtolower ($ part [8 ][0 ] . '/ ' . $ part [8 ][1 ]);
2253
- }
2254
- // multi-part
2255
- else {
2256
- for ($ n = 0 ; $ n < count ($ part [8 ]); $ n ++) {
2257
- if (!is_array ($ part [8 ][$ n ])) {
2258
- break ;
2259
- }
2252
+ // get real content-type of message/rfc822
2253
+ if ($ struct ->mimetype == 'message/rfc822 ' ) {
2254
+ // single-part
2255
+ if (!is_array ($ part [8 ][0 ]) && !is_array ($ part [8 ][1 ])) {
2256
+ $ struct ->real_mimetype = strtolower ($ part [8 ][0 ] . '/ ' . $ part [8 ][1 ]);
2257
+ }
2258
+ // multi-part
2259
+ else {
2260
+ for ($ n = 0 ; $ n < count ($ part [8 ]); $ n ++) {
2261
+ if (!is_array ($ part [8 ][$ n ])) {
2262
+ break ;
2260
2263
}
2261
- $ struct ->real_mimetype = 'multipart/ ' . strtolower ($ part [8 ][$ n ]);
2262
2264
}
2265
+ $ struct ->real_mimetype = 'multipart/ ' . strtolower ($ part [8 ][$ n ]);
2263
2266
}
2267
+ }
2264
2268
2265
- if ($ struct ->ctype_primary == 'message ' && empty ($ struct ->parts )) {
2266
- if (is_array ($ part [8 ]) && $ di != 8 ) {
2267
- $ struct ->parts [] = $ this ->structure_part ($ part [8 ], ++$ count , $ struct ->mime_id );
2268
- }
2269
+ if ($ struct ->ctype_primary == 'message ' && empty ($ struct ->parts )) {
2270
+ if (is_array ($ part [8 ]) && $ di != 8 ) {
2271
+ $ struct ->parts [] = $ this ->structure_part ($ part [8 ], ++$ count , $ struct ->mime_id );
2269
2272
}
2270
2273
}
2271
2274
0 commit comments