Changeset 95fd49e4 in github
- Timestamp:
- Jul 30, 2010 8:16:56 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 2537686
- Parents:
- e6ce006
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rdb1f1e3 r95fd49e4 2 2 =========================== 3 3 4 - Fix message structure parsing when it lacks optional fields (#1486881) 4 5 - Include all recipients in sendmail log 5 6 - Support HTTP_X_FORWARDED_PROTO header for HTTPS detecting (#1486866) -
program/include/rcube_imap.php
re6ce006 r95fd49e4 1748 1748 $struct->ctype_primary = 'multipart'; 1749 1749 1750 /* RFC3501: BODYSTRUCTURE fields of multipart part 1751 part1 array 1752 part2 array 1753 part3 array 1754 .... 1755 1. subtype 1756 2. parameters (optional) 1757 3. description (optional) 1758 4. language (optional) 1759 5. location (optional) 1760 */ 1761 1750 1762 // find first non-array entry 1751 1763 for ($i=1; $i<count($part); $i++) { … … 1759 1771 1760 1772 // build parts list for headers pre-fetching 1761 for ($i=0 , $count=0; $i<count($part); $i++) {1762 if ( is_array($part[$i]) && count($part[$i]) > 4) {1763 // fetch message headers if message/rfc8221764 // or named part (could contain Content-Location header)1765 if (!is_array($part[$i][0])) {1766 $tmp_part_id = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1;1767 if (strtolower($part[$i][0]) == 'message' && strtolower($part[$i][1]) == 'rfc822') {1768 $raw_part_headers[] = $tmp_part_id;1769 $mime_part_headers[] = $tmp_part_id;1770 }1771 else if (in_array('name', (array)$part[$i][2]) && (empty($part[$i][3]) || $part[$i][3]=='NIL')) {1772 $mime_part_headers[] = $tmp_part_id;1773 }1773 for ($i=0; $i<count($part); $i++) { 1774 if (!is_array($part[$i])) 1775 break; 1776 // fetch message headers if message/rfc822 1777 // or named part (could contain Content-Location header) 1778 if (!is_array($part[$i][0])) { 1779 $tmp_part_id = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1; 1780 if (strtolower($part[$i][0]) == 'message' && strtolower($part[$i][1]) == 'rfc822') { 1781 $raw_part_headers[] = $tmp_part_id; 1782 $mime_part_headers[] = $tmp_part_id; 1783 } 1784 else if (in_array('name', (array)$part[$i][2]) && (empty($part[$i][3]) || $part[$i][3]=='NIL')) { 1785 $mime_part_headers[] = $tmp_part_id; 1774 1786 } 1775 1787 } … … 1788 1800 $this->_msg_id, $raw_part_headers, false); 1789 1801 } 1802 1790 1803 $struct->parts = array(); 1791 1804 for ($i=0, $count=0; $i<count($part); $i++) { 1792 if (is_array($part[$i]) && count($part[$i]) > 4) { 1793 $tmp_part_id = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1; 1794 $struct->parts[] = $this->_structure_part($part[$i], ++$count, $struct->mime_id, 1805 if (!is_array($part[$i])) 1806 break; 1807 $tmp_part_id = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1; 1808 $struct->parts[] = $this->_structure_part($part[$i], ++$count, $struct->mime_id, 1795 1809 $mime_part_headers[$tmp_part_id], $raw_part_headers[$tmp_part_id]); 1796 }1797 1810 } 1798 1811 1799 1812 return $struct; 1800 1813 } 1814 1815 /* RFC3501: BODYSTRUCTURE fields of non-multipart part 1816 0. type 1817 1. subtype 1818 2. parameters 1819 3. id 1820 4. description 1821 5. encoding 1822 6. size 1823 -- text 1824 7. lines 1825 -- message/rfc822 1826 7. envelope structure 1827 8. body structure 1828 9. lines 1829 -- 1830 x. md5 (optional) 1831 x. disposition (optional) 1832 x. language (optional) 1833 x. location (optional) 1834 */ 1801 1835 1802 1836 // regular part … … 1826 1860 1827 1861 // read part disposition 1828 $di = count($part) - 2; 1829 if ((is_array($part[$di]) && count($part[$di]) == 2 && is_array($part[$di][1])) || 1830 (is_array($part[--$di]) && count($part[$di]) == 2)) { 1862 $di = 8; 1863 if ($struct->ctype_primary == 'text') $di += 1; 1864 else if ($struct->mimetype == 'message/rfc822') $di += 3; 1865 1866 if (is_array($part[$di]) && count($part[$di]) == 2) { 1831 1867 $struct->disposition = strtolower($part[$di][0]); 1832 1868 … … 1836 1872 } 1837 1873 1838 // get childparts1874 // get message/rfc822's child-parts 1839 1875 if (is_array($part[8]) && $di != 8) { 1840 1876 $struct->parts = array(); 1841 for ($i=0, $count=0; $i<count($part[8]); $i++) 1842 if (is_array($part[8][$i]) && count($part[8][$i]) > 5) 1843 $struct->parts[] = $this->_structure_part($part[8][$i], ++$count, $struct->mime_id); 1877 for ($i=0, $count=0; $i<count($part[8]); $i++) { 1878 if (!is_array($part[8][$i])) 1879 break; 1880 $struct->parts[] = $this->_structure_part($part[8][$i], ++$count, $struct->mime_id); 1881 } 1844 1882 } 1845 1883 … … 1876 1914 } 1877 1915 1878 if ($struct->ctype_primary =='message') {1916 if ($struct->ctype_primary == 'message') { 1879 1917 if (is_array($part[8]) && $di != 8 && empty($struct->parts)) 1880 1918 $struct->parts[] = $this->_structure_part($part[8], ++$count, $struct->mime_id);
Note: See TracChangeset
for help on using the changeset viewer.
