From d04d202234b0ba1e65b1c581acf0cbe715120dd7 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 22 Nov 2006 06:49:30 -0500
Subject: [PATCH] Remove newlines from mail headers (#1484031)

---
 program/include/rcube_imap.inc |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index a11c749..fafef67 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -1012,8 +1012,9 @@
 	  $struct->size = intval($part[6]);
 
 	// read part disposition
-    $di = count($part) - 3;
-    if (is_array($part[$di]))
+    $di = count($part) - 2;
+    if ((is_array($part[$di]) && count($part[$di]) == 2 && is_array($part[$di][1])) ||
+        (is_array($part[--$di]) && count($part[$di]) == 2))
       {
       $struct->disposition = strtolower($part[$di][0]);
 
@@ -1463,12 +1464,8 @@
   function get_quota()
     {
     if ($this->get_capability('QUOTA'))
-      {
-      $result = iil_C_GetQuota($this->conn);
-      if ($result["total"])
-        return sprintf("%.2fMB / %.2fMB (%.0f%%)", $result["used"] / 1000.0, $result["total"] / 1000.0, $result["percent"]);       
-      }
-
+      return iil_C_GetQuota($this->conn);
+	
     return FALSE;
     }
 
@@ -2380,7 +2377,8 @@
 
   function _parse_address_list($str)
     {
-    $a = $this->_explode_quoted_string(',', $str);
+    // remove any newlines and carriage returns before
+    $a = $this->_explode_quoted_string(',', preg_replace( "/[\r\n]/", " ", $str));
     $result = array();
     
     foreach ($a as $key => $val)

--
Gitblit v1.9.1