From b08caf5813c43e8648cdf5db1e003b3046a37c2c Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 31 Aug 2011 08:49:44 -0400
Subject: [PATCH] - Applied fixes from trunk up to r5150

---
 program/include/rcube_imap.php |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 6a35af0..1b31112 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -3074,6 +3074,9 @@
         if (isset($data['folders'])) {
             $a_folders = $data['folders'];
         }
+        else if (!$this->conn->connected()) {
+           return array();
+        }
         else {
             // Server supports LIST-EXTENDED, we can use selection options
             $config = rcmail::get_instance()->config;
@@ -3834,13 +3837,13 @@
     /**
      * Enable or disable indexes caching
      *
-     * @param boolean $type Cache type (@see rcmail::get_cache)
+     * @param string $type Cache type (@see rcmail::get_cache)
      * @access public
      */
     function set_caching($type)
     {
         if ($type) {
-            $this->caching = true;
+            $this->caching = $type;
         }
         else {
             if ($this->cache)
@@ -3857,7 +3860,7 @@
     {
         if ($this->caching && !$this->cache) {
             $rcmail = rcmail::get_instance();
-            $this->cache = $rcmail->get_cache('IMAP', $type);
+            $this->cache = $rcmail->get_cache('IMAP', $this->caching);
         }
 
         return $this->cache;

--
Gitblit v1.9.1