瀏覽代碼

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 年之前
父節點
當前提交
358d622748
共有 1 個文件被更改,包括 3 次插入0 次删除
  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
                     // remove the result and request it again  with a list
                     // response at a later stage.
                     // response at a later stage.
                     unset($lsub_ary[$i]);
                     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;
                 break;
             }
             }