From 00c2a90f69b0e997de5da20b84e2c535c90d3f38 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 08 Jul 2013 02:48:16 -0400
Subject: [PATCH] Fix "could not load message" error on valid empty message body (#1489228)

---
 program/lib/Roundcube/rcube_imap_generic.php |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index ab2e63d..365525b 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -2509,7 +2509,11 @@
                 $prev  = '';
                 $found = true;
 
-                while ($bytes > 0) {
+                // empty body
+                if (!$bytes) {
+                    $result = '';
+                }
+                else while ($bytes > 0) {
                     $line = $this->readLine(8192);
 
                     if ($line === NULL) {

--
Gitblit v1.9.1