From 64e3e80743415e5fb121eb5c66416593c38ef288 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 08 Jun 2010 08:46:05 -0400
Subject: [PATCH] - Fix some IMAP errors handling when opening the message (#1485443)

---
 program/include/rcube_imap.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index f48372a..6f3b402 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2061,7 +2061,7 @@
             return true;
 
         // convert charset (if text or message part)
-        if ($o_part->ctype_primary == 'text' || $o_part->ctype_primary == 'message') {
+        if ($body && ($o_part->ctype_primary == 'text' || $o_part->ctype_primary == 'message')) {
             // assume default if no charset specified
             if (empty($o_part->charset) || strtolower($o_part->charset) == 'us-ascii')
                 $o_part->charset = $this->default_charset;
@@ -2628,7 +2628,7 @@
             // retrieve list of folders from IMAP server
             $a_mboxes = $this->conn->listMailboxes($this->mod_mailbox($root), $filter);
         }
-        
+
         $a_folders = array();
         if (!is_array($a_mboxes))
             $a_mboxes = array();

--
Gitblit v1.9.1