Why did we have two eregi() functions in a row? I changed it so one regexp
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 16 Jan 2001 19:24:00 +0000 (19:24 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 16 Jan 2001 19:24:00 +0000 (19:24 +0000)
should do it.

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

functions/imap_mailbox.php

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