Changeset 5192 in subversion
- Timestamp:
- Sep 8, 2011 4:31:13 AM (21 months ago)
- Location:
- trunk/roundcubemail/program/include
- Files:
-
- 2 edited
-
rcube_imap.php (modified) (1 diff)
-
rcube_imap_cache.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.php
r5190 r5192 2000 2000 2001 2001 $struct = &$this->_structure_part($structure, 0, '', $headers); 2002 $struct->headers = get_object_vars($headers);2003 2002 2004 2003 // don't trust given content-type 2005 if (empty($struct->parts) && !empty($ struct->headers['ctype'])) {2004 if (empty($struct->parts) && !empty($headers->ctype)) { 2006 2005 $struct->mime_id = '1'; 2007 $struct->mimetype = strtolower($ struct->headers['ctype']);2006 $struct->mimetype = strtolower($headers->ctype); 2008 2007 list($struct->ctype_primary, $struct->ctype_secondary) = explode('/', $struct->mimetype); 2009 2008 } -
trunk/roundcubemail/program/include/rcube_imap_cache.php
r5190 r5192 889 889 // Save current message from internal cache 890 890 if ($message = $this->icache['message']) { 891 $object = $message['object']; 892 // remove body too big (>500kB) 893 if ($object->body && strlen($object->body) > 500 * 1024) 894 $object->body = null; 891 // clean up some object's data 892 $object = $this->message_object_prepare($message['object']); 895 893 896 894 // calculate current md5 sum … … 905 903 } 906 904 905 906 /** 907 * Prepares message object to be stored in database. 908 */ 909 private function message_object_prepare($msg, $recursive = false) 910 { 911 // Remove body too big (>500kB) 912 if ($recursive || ($msg->body && strlen($msg->body) > 500 * 1024)) { 913 unset($msg->body); 914 } 915 916 // Fix mimetype which might be broken by some code when message is displayed 917 // Another solution would be to use object's copy in rcube_message class 918 // to prevent related issues, however I'm not sure which is better 919 if ($msg->mimetype) { 920 list($msg->ctype_primary, $msg->ctype_secondary) = explode('/', $msg->mimetype); 921 } 922 923 if (is_array($msg->structure->parts)) { 924 foreach ($msg->structure->parts as $idx => $part) { 925 $msg->structure->parts[$idx] = $this->message_object_prepare($part, true); 926 } 927 } 928 929 return $msg; 930 } 907 931 }
Note: See TracChangeset
for help on using the changeset viewer.
