unsetting an array element didn't re-index the array which caused a failure
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 2 Mar 2004 21:05:57 +0000 (21:05 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 2 Mar 2004 21:05:57 +0000 (21:05 +0000)
when we added the INBOX response to the array at a later stage. This is
confirmed on PHP 4.1.2. The version I'm using (4.3.4) didn't had that
problem. Probably this fix us a php-bug workaround.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6732 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php

index a5a6277..3e14e7c 100755 (executable)
@@ -823,6 +823,9 @@ function sqimap_mailbox_tree($imap_stream) {
                     // remove the result and request it again  with a list
                     // response at a later stage.
                     unset($lsub_ary[$i]);
+                    // re-index the array otherwise the addition of the LIST 
+                    // response will fail in PHP 4.1.2 and probably other older versions
+                    $lsub_ary = array_values($lsub_ary);
                 }
                 break;
             }