From 6b79f7b57a51141dbef44011cdf0ebacf5f74c8c Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 26 Sep 2007 15:13:22 +0000 Subject: Set default IMAP folder delimiter; make sure is not empty --- program/steps/settings/manage_folders.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'program/steps/settings') diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc index 177f60b25..0d430cac5 100644 --- a/program/steps/settings/manage_folders.inc +++ b/program/steps/settings/manage_folders.inc @@ -75,8 +75,9 @@ else if ($_action=='rename-folder') if ($rename && $OUTPUT->ajax_call) { - $foldersplit = explode($IMAP->delimiter, $rename); - $display_rename = str_repeat('    ', substr_count($rename, $IMAP->delimiter)) . rcube_charset_convert($foldersplit[count($foldersplit)-1], 'UTF-7'); + $foldersplit = $IMAP->delimiter ? explode($IMAP->delimiter, $rename) : array($rename); + $level = count($foldersplit) - 1; + $display_rename = str_repeat('    ', $level) . rcube_charset_convert($foldersplit[$level], 'UTF-7'); $OUTPUT->command('replace_folder_row', $oldname, $rename, $display_rename); $OUTPUT->command('reset_folder_rename'); $OUTPUT->send(); @@ -165,8 +166,9 @@ function rcube_subscription_form($attrib) $protected = ($CONFIG['protect_default_folders'] == TRUE && in_array($folder,$CONFIG['default_imap_folders'])); $zebra_class = $i%2 ? 'even' : 'odd'; $folder_js = JQ($folder); - $foldersplit = explode($IMAP->delimiter, $folder); - $display_folder = str_repeat('    ', substr_count($folder, $IMAP->delimiter)) . rcube_charset_convert($foldersplit[count($foldersplit)-1], 'UTF-7'); + $foldersplit = $IMAP->delimiter ? explode($IMAP->delimiter, $folder) : array($folder); + $level = count($foldersplit) - 1; + $display_folder = str_repeat('    ', $level) . rcube_charset_convert($foldersplit[$level], 'UTF-7'); $folder_html = $CONFIG['protect_default_folders'] && in_array($folder, $CONFIG['default_imap_folders']) ? rcube_label(strtolower($folder)) : $display_folder; if (!$protected) -- cgit v1.2.3