From 793642ed76b5c26487136d2b547178e067afe113 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 22 Oct 2014 19:02:23 +0200 Subject: Fix handling of uuencoded messages if messages_cache is enabled (#1490108) Conflicts: program/lib/Roundcube/rcube_message.php --- program/lib/Roundcube/rcube_imap_cache.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'program/lib/Roundcube/rcube_imap_cache.php') diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php index e49e77803..4b263b1f0 100644 --- a/program/lib/Roundcube/rcube_imap_cache.php +++ b/program/lib/Roundcube/rcube_imap_cache.php @@ -1235,13 +1235,15 @@ class rcube_imap_cache private function message_object_prepare(&$msg, &$size = 0) { // Remove body too big - if ($msg->body && ($length = strlen($msg->body))) { - $size += $length; + if (isset($msg->body)) { + $length = strlen($msg->body); - if ($size > $this->threshold * 1024) { - $size -= $length; + if ($msg->body_modified || $size + $length > $this->threshold * 1024) { unset($msg->body); } + else { + $size += $length; + } } // Fix mimetype which might be broken by some code when message is displayed -- cgit v1.2.3