From 99f3175e172314d8c23ee9892beb2619c1aface1 Mon Sep 17 00:00:00 2001 From: alex-brainstorm Date: Sun, 27 Jul 2003 00:44:15 +0000 Subject: [PATCH] Replace None mailbox with first available mailbox (eg INBOX) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5431 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/search.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/search.php b/src/search.php index 97eb545f..b8e4b6c8 100644 --- a/src/search.php +++ b/src/search.php @@ -837,12 +837,13 @@ else { $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); /* get mailbox names once here */ $boxes = sqimap_mailbox_list($imapConnection); - -if (isset($mailbox_array[0])) { - $mailbox = strip_tags($mailbox_array[0]); -} -if (empty($mailbox)) +/* ensure we have a valid default mailbox name */ +$mailbox = strip_tags(asearch_nz($mailbox_array[0])); +if (($mailbox == '') || ($mailbox == 'None')) { //Workaround for sm quirk IMHO (what if I really have a mailbox called None?) $mailbox = $boxes[0]['unformatted']; + $mailbox_array[0] = $mailbox; +} + if (isset($composenew) && $composenew) { $comp_uri = "../src/compose.php?mailbox=" . urlencode($mailbox) . "&session=$composesession&attachedmessages=true&"; -- 2.25.1