Changeset 3843 in subversion
- Timestamp:
- Jul 30, 2010 8:46:00 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.php
r3842 r3843 1739 1739 * @access private 1740 1740 */ 1741 function &_structure_part($part, $count=0, $parent='', $mime_headers=null , $raw_headers=null)1741 function &_structure_part($part, $count=0, $parent='', $mime_headers=null) 1742 1742 { 1743 1743 $struct = new rcube_message_part; … … 1779 1779 $tmp_part_id = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1; 1780 1780 if (strtolower($part[$i][0]) == 'message' && strtolower($part[$i][1]) == 'rfc822') { 1781 $raw_part_headers[] = $tmp_part_id;1782 1781 $mime_part_headers[] = $tmp_part_id; 1783 1782 } … … 1795 1794 $this->_msg_id, $mime_part_headers); 1796 1795 } 1797 // we'll need a real content-type of message/rfc822 part1798 if ($raw_part_headers) {1799 $raw_part_headers = $this->conn->fetchMIMEHeaders($this->mailbox,1800 $this->_msg_id, $raw_part_headers, false);1801 }1802 1796 1803 1797 $struct->parts = array(); … … 1807 1801 $tmp_part_id = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1; 1808 1802 $struct->parts[] = $this->_structure_part($part[$i], ++$count, $struct->mime_id, 1809 $mime_part_headers[$tmp_part_id] , $raw_part_headers[$tmp_part_id]);1803 $mime_part_headers[$tmp_part_id]); 1810 1804 } 1811 1805 … … 1899 1893 $struct->headers = $this->_parse_headers($mime_headers) + $struct->headers; 1900 1894 1901 // get real headers for message of type 'message/rfc822'1895 // get real content-type of message/rfc822 1902 1896 if ($struct->mimetype == 'message/rfc822') { 1903 if (empty($raw_headers)) { 1904 $raw_headers = $this->conn->fetchMIMEHeaders( 1905 $this->mailbox, $this->_msg_id, (array)$struct->mime_id, false); 1897 // single-part 1898 if (!is_array($part[8][0])) 1899 $struct->real_mimetype = strtolower($part[8][0] . '/' . $part[8][1]); 1900 // multi-part 1901 else { 1902 for ($n=0; $n<count($part[8]); $n++) 1903 if (!is_array($part[8][$n])) 1904 break; 1905 $struct->real_mimetype = 'multipart/' . strtolower($part[8][$n]); 1906 1906 } 1907 $struct->real_headers = $this->_parse_headers($raw_headers); 1908 1909 // get real content-type of message/rfc822 1910 if (preg_match('/^([a-z0-9_\/-]+)/i', $struct->real_headers['content-type'], $matches)) { 1911 $struct->real_mimetype = strtolower($matches[1]); 1912 } 1913 } 1914 } 1915 1916 if ($struct->ctype_primary == 'message') { 1917 if (is_array($part[8]) && $di != 8 && empty($struct->parts)) 1918 $struct->parts[] = $this->_structure_part($part[8], ++$count, $struct->mime_id); 1907 } 1908 1909 if ($struct->ctype_primary == 'message' && empty($struct->parts)) { 1910 if (is_array($part[8]) && $di != 8) 1911 $struct->parts[] = $this->_structure_part($part[8], ++$count, $struct->mime_id); 1912 } 1919 1913 } 1920 1914
Note: See TracChangeset
for help on using the changeset viewer.
