Browse Source

unsetting an array element didn't re-index the array which caused a failure
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.

stekkel 21 years ago
parent
commit
358d622748
1 changed files with 3 additions and 0 deletions
  1. 3 0
      functions/imap_mailbox.php

+ 3 - 0
functions/imap_mailbox.php

@@ -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;
             }