From 7ce96393d11f4d1ebdb2db1585bf4ea406db56dd Mon Sep 17 00:00:00 2001 From: jmunro Date: Tue, 19 Mar 2002 18:22:05 +0000 Subject: [PATCH] fix orphaned subfolders on the folder list when they are subfolders of a special mailbox and "list special boxes first" is on git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2607 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 6c4d916e..351993c9 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -338,7 +338,7 @@ function user_strcasecmp($a, $b) { * See comment on sqimap_mailbox_parse() for info about the returned array. */ function sqimap_mailbox_list($imap_stream) { - global $boxesnew; + global $boxesnew, $default_folder_prefix; if ( !isset( $boxesnew ) ) { @@ -460,7 +460,6 @@ function sqimap_mailbox_list($imap_stream) { $used[$k] = false; } } - /* List special folders and their subfolders, if requested. */ if ($list_special_folders_first) { foreach ( $boxesall as $k => $box ) { @@ -468,6 +467,10 @@ function sqimap_mailbox_list($imap_stream) { $boxesnew[] = $box; $used[$k] = true; } + if (!$used[$k] && preg_match("/$default_folder_prefix(Sent|Drafts|Trash)/", $box['unformatted']) ) { + $boxesnew[] = $box; + $used[$k] = true; + } } } @@ -479,7 +482,6 @@ function sqimap_mailbox_list($imap_stream) { } } } - return $boxesnew; } -- 2.25.1