From a4468298c8506d9cd35b805885c0d2b684835f8a Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 15 Apr 2010 08:21:03 -0400
Subject: [PATCH] - fix sorting of folders with capital letters

---
 program/include/rcube_imap.php |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 22f4979..466c47a 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2541,24 +2541,23 @@
      */
     function list_unsubscribed($root='')
     {
-        static $sa_unsubscribed;
+        static $a_folders;
     
-        if (is_array($sa_unsubscribed))
-            return $sa_unsubscribed;
+        if (is_array($a_folders))
+            return $a_folders;
       
         // retrieve list of folders from IMAP server
         $a_mboxes = $this->conn->listMailboxes($this->mod_mailbox($root), '*');
 
         // modify names with root dir
         foreach ($a_mboxes as $mbox_name) {
-            $name = $this->mod_mailbox($mbox_name, 'out');
-            if (strlen($name))
+            if ($name = $this->mod_mailbox($mbox_name, 'out'))
                 $a_folders[] = $name;
         }
 
         // filter folders and sort them
-        $sa_unsubscribed = $this->_sort_mailbox_list($a_folders);
-        return $sa_unsubscribed;
+        $a_folders = $this->_sort_mailbox_list($a_folders);
+        return $a_folders;
     }
 
 
@@ -3533,7 +3532,7 @@
             if (($p = array_search($folder, $this->default_folders)) !== false && !$a_defaults[$p])
                 $a_defaults[$p] = $folder;
             else
-                $folders[$folder] = mb_strtolower(rcube_charset_convert($folder, 'UTF7-IMAP'));
+                $folders[$folder] = rcube_charset_convert($folder, 'UTF7-IMAP');
         }
 
         // sort folders and place defaults on the top

--
Gitblit v1.9.1