fix mailbox list (noselect and array_values)
authoralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 4 Jul 2003 22:06:13 +0000 (22:06 +0000)
committeralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 4 Jul 2003 22:06:13 +0000 (22:06 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5215 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php

index 223456d..d623e14 100755 (executable)
@@ -538,8 +538,8 @@ function sqimap_mailbox_list($imap_stream) {
                 $inbox_subscribed = true;
             }
         }
-        /* remove duplicates */
-        $sorted_lsub_ary = array_unique($sorted_lsub_ary);
+        /* remove duplicates and ensure array is contiguous, so we don't rely on sort()' side-effect that fails if count()==1 */
+        $sorted_lsub_ary = array_values(array_unique($sorted_lsub_ary));
 
         /* natural sort mailboxes */
         if (isset($sorted_lsub_ary)) {
@@ -718,6 +718,7 @@ function sqimap_mailbox_tree($imap_stream) {
 
         $inbox_in_list = false;
         $inbox_subscribed = false;
+        $noselect = false;
 
         require_once(SM_PATH . 'include/load_prefs.php');