Changed the second ereg() function to a strcasecmp also.
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 17 Jan 2001 17:11:20 +0000 (17:11 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 17 Jan 2001 17:11:20 +0000 (17:11 +0000)
Changed the "== 0" into negation
 - faster than a compare by a nanosecond or less   :-)
Same went for "else if" to "elseif"
(Hope I didn't break it again)

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

functions/imap_mailbox.php

index bbd2fa40de0fd5763771469c20d73e2e29130093..2233f238482f3df0f33ce696c95731d9f786bb97 100755 (executable)
 
          // Then list special folders and their subfolders
          for ($i = 0 ; $i <= count($boxes) ; $i++) {
-            if(((strcasecmp($trash_folder, $boxes[$i]["unformatted"]) == 0) ||
-                eregi("^".quotemeta($trash_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
-               ($move_to_trash)) {        
+            if ((!strcasecmp($trash_folder, $boxes[$i]["unformatted"]) ||
+                !strcasecmp($trash_folder . $dm, $boxes[$i]["unformatted"] )
+               && ($move_to_trash)) {        
                $boxesnew[] = $boxes[$i];
                $boxes[$i]["used"] = true;
             }
-           else if(((strcasecmp($sent_folder, $boxes[$i]["unformatted"]) == 0) ||
-                     eregi("^".quotemeta($sent_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
-                    ($move_to_sent)) {        
+            elseif ((!strcasecmp($sent_folder, $boxes[$i]["unformatted"]) ||
+                !strcasecmp($sent_folder . $dm, $boxes[$i]["unformatted"] )
+               && ($move_to_sent)) {        
                $boxesnew[] = $boxes[$i];
                $boxes[$i]["used"] = true;
             }