Changeset 5621
- Timestamp:
- 03/05/12 09:22:46 (12 years ago)
- Location:
- branches/2.3/expressoMail1_2/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/inc/class.imap_attachment.inc.php
r3289 r5621 2 2 class imap_attachment 3 3 { 4 function flattenParts($messageParts, $flattenedParts = array(), $prefix = '', $index = 1, $fullPrefix = true) { 5 6 foreach($messageParts as $part) { 7 $flattenedParts[$prefix.$index] = $part; 8 if(isset($part->parts)) { 9 if($part->type == 2) { 10 $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix.$index.'.', 0, false); 11 } 12 elseif($fullPrefix) { 13 $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix.$index.'.'); 14 } 15 else { 16 $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix); 17 } 18 unset($flattenedParts[$prefix.$index]->parts); 19 } 20 $index++; 21 } 22 23 return $flattenedParts; 24 25 } 26 4 27 function get_attachment_info($mbox_stream, $msg_number) 5 28 { 6 29 $structure = imap_fetchstructure($mbox_stream,$msg_number,FT_UID); 30 $aaa = $this->flattenParts($structure->parts); 7 31 $contentParts = count($structure->parts); 8 32 … … 13 37 for($i=1; $i<$contentParts; $i++) 14 38 { 15 $msg_info['attachment'][$i]['part_in_msg'] = ($i +1);39 $msg_info['attachment'][$i]['part_in_msg'] = ($i); 16 40 $msg_info['attachment'][$i]['name'] = urlencode($structure->parts[$i]->dparameters[0]->value); 17 41 $msg_info['attachment'][$i]['type'] = $structure->parts[$i]->subtype; -
branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php
r5226 r5621 1091 1091 $msg->encoding[ $msg_number ][ $values ] = 'quoted-printable'; 1092 1092 } 1093 1093 /* 1094 1094 $body = $this->decodeBody( 1095 1095 imap_fetchbody( 1096 1096 $this->mbox, 1097 1097 $msg_number, … … 1101 1101 $msg->encoding[ $msg_number ][ $values ], 1102 1102 $msg->charset[ $msg_number ][ $values ] 1103 ); 1104 1103 ); 1104 */ 1105 $body = $this->decodeBody( 1106 imap_fetchbody( 1107 $this->mbox, 1108 $msg_number, 1109 $attachment['part_in_msg'] . ".1", 1110 FT_UID 1111 ), 1112 $msg->encoding[ $msg_number ][ $values ], 1113 $msg->charset[ $msg_number ][ $values ] 1114 ); 1115 1105 1116 if ( strtolower( $msg->structure[$msg_number]->parts[1]->parts[0]->subtype ) == 'plain' ) 1106 1117 {
Note: See TracChangeset
for help on using the changeset viewer.