Removed a lot of the warnings generated when PHP has all warnings enabled.
[squirrelmail.git] / functions / imap_mailbox.php
index 33801b2779899f09e7e24da35e9fd68a59672ab8..72666d72e7447db230a6674c6198392f6b24af84 100755 (executable)
@@ -3,6 +3,8 @@
     **  imap_mailbox.php
     **
     **  This impliments all functions that manipulate mailboxes
+    **
+    **  $Id$
     **/
 
    /******************************************************************************
       if ($list_special_folders_first == true) {
 
          // Then list special folders and their subfolders
-         for ($i = 0 ; $i <= count($boxes) ; $i++) {
+         for ($i = 0 ; $i < count($boxes) ; $i++) {
             if ($move_to_trash &&
                eregi("^" . quotemeta($trash_folder) . "(" .
                quotemeta($dm) . ".*)?$", $boxes[$i]["unformatted"])) {
          }
 
          // Put INBOX.* folders ahead of the rest
-         for ($i = 0; $i <= count($boxes); $i++) {
+         for ($i = 0; $i < count($boxes); $i++) {
             if (eregi("^inbox\.", $boxes[$i]["unformatted"]) &&
-                ($boxes[$i]["used"] == false)) {
+                (!isset($boxes[$i]["used"]) || $boxes[$i]["used"] == false)) {
                $boxesnew[] = $boxes[$i];
                $boxes[$i]["used"] = true;
             }