summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap_cache.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-10-22 19:02:23 +0200
committerAleksander Machniak <alec@alec.pl>2014-10-22 19:02:23 +0200
commit2268aa676d4f21f0f26b4c802c6fb9c2c631d206 (patch)
treefba930554cd7ba33e23fc28138889392101c4c23 /program/lib/Roundcube/rcube_imap_cache.php
parentd165d11012a3814b129b3dab6419212bad8e5872 (diff)
Fix handling of uuencoded messages if messages_cache is enabled (#1490108)
Diffstat (limited to 'program/lib/Roundcube/rcube_imap_cache.php')
-rw-r--r--program/lib/Roundcube/rcube_imap_cache.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php
index 95498e364..81df07641 100644
--- a/program/lib/Roundcube/rcube_imap_cache.php
+++ b/program/lib/Roundcube/rcube_imap_cache.php
@@ -1245,13 +1245,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