From 9e60d4b9916fcbb1a765b85fbf57b28e5cfddb84 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 21 Mar 2008 08:03:45 -0400
Subject: [PATCH] Applied patch to fix mime decoding an folder subscription (#1484191)

---
 program/include/rcube_imap.inc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index bec429f..94f5017 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -1674,7 +1674,7 @@
     if (is_array($mbox_name))
       $a_mboxes = $mbox_name;
     else if (is_string($mbox_name) && strlen($mbox_name))
-      $a_mboxes = explode(',', $mbox_name);
+      $a_mboxes = (array)$mbox_name;
 
     // let this common function do the main work
     return $this->_change_subscription($a_mboxes, 'unsubscribe');
@@ -2335,6 +2335,10 @@
     $pos = strpos($input, '=?');
     if ($pos !== false)
       {
+      // rfc: all line breaks or other characters not found in the Base64 Alphabet must be ignored by decoding software
+      // delete all blanks between MIME-lines, differently we can receive unnecessary blanks and broken utf-8 symbols
+      $input = preg_replace("/\?=\s+=\?/", '?==?', $input);
+
       $out = substr($input, 0, $pos);
   
       $end_cs_pos = strpos($input, "?", $pos+2);

--
Gitblit v1.9.1