summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-09-26 15:13:22 +0000
committerthomascube <thomas@roundcube.net>2007-09-26 15:13:22 +0000
commit6b79f7b57a51141dbef44011cdf0ebacf5f74c8c (patch)
tree57c3aef273fb96a7f7bd4c0843ab1666d90521b9 /program/steps
parent852440bd26f805985e7ac9c7ac3fd19b92b3ca25 (diff)
Set default IMAP folder delimiter; make sure is not empty
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/settings/manage_folders.inc10
1 files changed, 6 insertions, 4 deletions
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('&nbsp;&nbsp;&nbsp;&nbsp;', 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('&nbsp;&nbsp;&nbsp;&nbsp;', $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('&nbsp;&nbsp;&nbsp;&nbsp;', 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('&nbsp;&nbsp;&nbsp;&nbsp;', $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)