Fix for moving last message in a folder.
[squirrelmail.git] / functions / imap_mailbox.php
index a5a6277c7c6a2b28f3d18e021c3e27bcac0af244..3e14e7c3adcbe5b6b8bfcc46ebc1bb433ad11524 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;
             }