From 718cfbb233ff039755bc3e1dfacc1a9f3395ccb7 Mon Sep 17 00:00:00 2001 From: fidian Date: Tue, 16 Jan 2001 19:24:00 +0000 Subject: [PATCH] Why did we have two eregi() functions in a row? I changed it so one regexp 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 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 8e2600f0..01ab0f9a 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -258,15 +258,17 @@ // 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; } -- 2.25.1