diff options
Diffstat (limited to 'program/lib/Roundcube/rcube_message.php')
-rw-r--r-- | program/lib/Roundcube/rcube_message.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php index 0d33ba411..3644d6b8e 100644 --- a/program/lib/Roundcube/rcube_message.php +++ b/program/lib/Roundcube/rcube_message.php @@ -222,6 +222,7 @@ class rcube_message // part body not fetched yet... save in memory if it's small enough if ($part->body === null && is_numeric($mime_id) && $part->size < self::BODY_MAX_SIZE) { + $this->storage->set_folder($this->folder); // Warning: body here should be always unformatted $part->body = $this->storage->get_message_part($this->uid, $mime_id, $part, null, null, true, 0, false); @@ -263,17 +264,18 @@ class rcube_message $this->storage->set_folder($this->folder); $body = $this->storage->get_message_part($this->uid, $mime_id, $part, - $mode === -1, is_resource($mode) ? $mode : null, !$formatted, $max_bytes, $formatted); - - if (!$mode && $body && $formatted) { - $body = self::format_part_body($body, $part, $this->headers->charset); - } + $mode === -1, is_resource($mode) ? $mode : null, + !($mode && $formatted), $max_bytes, $mode && $formatted); if (is_resource($mode)) { rewind($mode); return $body !== false; } + if (!$mode && $body && $formatted) { + $body = self::format_part_body($body, $part, $this->headers->charset); + } + return $body; } |