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:09:27 +0200
commit793642ed76b5c26487136d2b547178e067afe113 (patch)
tree65e6e76c0e8b706a505f11a5f6625fd12e94da6e /program/lib/Roundcube/rcube_imap_cache.php
parent3db15995382ccf551aee8387ebb5ca073d197f27 (diff)
Fix handling of uuencoded messages if messages_cache is enabled (#1490108)
Conflicts: program/lib/Roundcube/rcube_message.php
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 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