Browse Source

Replaced an eregi() with strcasecmp() which should be considerably faster.

pallo 24 years ago
parent
commit
4d1e0a14bd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      functions/imap_mailbox.php

+ 2 - 2
functions/imap_mailbox.php

@@ -258,13 +258,13 @@
 
 
          // Then list special folders and their subfolders
          // Then list special folders and their subfolders
          for ($i = 0 ; $i <= count($boxes) ; $i++) {
          for ($i = 0 ; $i <= count($boxes) ; $i++) {
-            if((eregi("^".quotemeta($trash_folder).'$', $boxes[$i]["unformatted"]) ||
+            if(((strcasecmp($trash_folder, $boxes[$i]["unformatted"]) == 0) ||
                 eregi("^".quotemeta($trash_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
                 eregi("^".quotemeta($trash_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
                ($move_to_trash)) {        
                ($move_to_trash)) {        
                $boxesnew[] = $boxes[$i];
                $boxesnew[] = $boxes[$i];
                $boxes[$i]["used"] = true;
                $boxes[$i]["used"] = true;
             }
             }
-            else if((eregi("^".quotemeta($sent_folder).'$', $boxes[$i]["unformatted"]) ||
+	    else if(((strcasecmp($sent_folder, $boxes[$i]["unformatted"]) == 0) ||
                      eregi("^".quotemeta($sent_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
                      eregi("^".quotemeta($sent_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
                     ($move_to_sent)) {        
                     ($move_to_sent)) {        
                $boxesnew[] = $boxes[$i];
                $boxesnew[] = $boxes[$i];