summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-10-25 10:49:53 +0000
committeralecpl <alec@alec.pl>2010-10-25 10:49:53 +0000
commit10f08e6ce02dc81dd2baa18cbe135f7352d370f4 (patch)
tree02a2930fdf09bbdf87fc1b886980de67e0e1f15a /program/include
parent2b42838427c887c8704afd033e5f17172216f82f (diff)
- Fix setting 'virtual' flag for non-existing folders in some cases
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index d5cebc2ad..46e45f7cb 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1270,7 +1270,7 @@ function rcmail_mailbox_list($attrib)
foreach ($a_folders as $folder)
rcmail_build_folder_tree($a_mailboxes, $folder, $delimiter);
}
-
+
// allow plugins to alter the folder tree or to localize folder names
$hook = $RCMAIL->plugins->exec_hook('render_mailboxlist', array('list' => $a_mailboxes, 'delimiter' => $delimiter));
@@ -1333,10 +1333,18 @@ function rcmail_mailbox_select($p = array())
function rcmail_build_folder_tree(&$arrFolders, $folder, $delm='/', $path='')
{
$pos = strpos($folder, $delm);
+
if ($pos !== false) {
$subFolders = substr($folder, $pos+1);
$currentFolder = substr($folder, 0, $pos);
- $virtual = !isset($arrFolders[$currentFolder]);
+
+ // sometimes folder has a delimiter as the last character
+ if (empty($subFolders))
+ $virtual = false;
+ else if (!isset($arrFolders[$currentFolder]))
+ $virtual = true;
+ else
+ $virtual = $arrFolders[$currentFolder]['virtual'];
}
else {
$subFolders = false;