remove the % from the LSUB request because we do not need it.
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 28 Jul 2003 18:48:55 +0000 (18:48 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 28 Jul 2003 18:48:55 +0000 (18:48 +0000)
fixed speed issue for loop

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

functions/imap_mailbox.php

index 8d349a196ae01dbd6025a4f93e6c34f88b9196db..83fff2fbc3696632e6f255bf2c6282daf3d72eb8 100755 (executable)
@@ -114,7 +114,7 @@ function compact_mailboxes_response($ary)
      * FIXME : Doesn't work if the mailbox name is multiple lines 
      * (larger then fgets buffer)
      */
-    for ($i = 0; $i < count($ary); $i++) {
+    for ($i = 0, $iCnt=count($ary); $i < $iCnt; $i++) {
         if (isset($ary[$i + 1]) && substr($ary[$i], -3) == "}\r\n") {
             if (ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
                  $ary[$i], $regs)) {
@@ -720,7 +720,7 @@ function sqimap_mailbox_tree($imap_stream) {
         require_once(SM_PATH . 'include/load_prefs.php');
 
         /* LSUB array */
-        $lsub_ary = sqimap_run_command ($imap_stream, "LSUB \"$folder_prefix\" \"*%\"",
+        $lsub_ary = sqimap_run_command ($imap_stream, "LSUB \"$folder_prefix\" \"*\"",
                                         true, $response, $message);
         $lsub_ary = compact_mailboxes_response($lsub_ary);