diff options
Diffstat (limited to 'program/steps/settings/folders.inc')
-rw-r--r-- | program/steps/settings/folders.inc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 44482e938..778d93c03 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -109,7 +109,7 @@ else if ($RCMAIL->action == 'delete-folder') else if ($RCMAIL->action == 'rename-folder') { $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, true)); - $oldname_utf8 = get_input_value('_folder_oldname', RCUBE_INPUT_POST, true); + $oldname_utf8 = trim(get_input_value('_folder_oldname', RCUBE_INPUT_POST, true)); if (strlen($name_utf8) && strlen($oldname_utf8)) { $name = rcube_charset_convert($name_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); @@ -167,7 +167,7 @@ else if ($RCMAIL->action == 'purge') // get mailbox size else if ($RCMAIL->action == 'folder-size') { - $name = get_input_value('_mbox', RCUBE_INPUT_POST, true); + $name = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true)); $size = $STORAGE->folder_size($name); @@ -232,16 +232,16 @@ function rcube_subscription_form($attrib) // add any necessary "virtual" parent folders if ($parent_folder && !isset($seen[$parent_folder])) { for ($i=1; $i<=$level; $i++) { - $ancestor_folder = join($delimiter, array_slice($foldersplit, 0, $i)); - if ($ancestor_folder && !$seen[$ancestor_folder]++) { - $ancestor_name = rcube_charset_convert($foldersplit[$i-1], 'UTF7-IMAP'); - $list_folders[] = array( + $ancestor_folder = join($delimiter, array_slice($foldersplit, 0, $i)); + if ($ancestor_folder && !$seen[$ancestor_folder]++) { + $ancestor_name = rcube_charset_convert($foldersplit[$i-1], 'UTF7-IMAP'); + $list_folders[] = array( 'id' => $ancestor_folder, 'name' => $ancestor_name, 'level' => $i-1, 'virtual' => true, ); - } + } } } @@ -283,6 +283,7 @@ function rcube_subscription_form($attrib) $noselect = false; $classes = array($i%2 ? 'even' : 'odd'); + $folder_js = Q($folder['id']); $folder_utf8 = rcube_charset_convert($folder['id'], 'UTF7-IMAP'); $display_folder = str_repeat(' ', $folder['level']) . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']); @@ -291,8 +292,7 @@ function rcube_subscription_form($attrib) $classes[] = 'virtual'; } - // Check \Noselect flag (of existing folder) - if (!$protected && in_array($folder['id'], $a_unsubscribed)) { + if (!$protected) { $attrs = $STORAGE->folder_attributes($folder['id']); $noselect = in_array('\\Noselect', $attrs); } @@ -394,7 +394,7 @@ function rcmail_rename_folder($oldname, $newname) $a_threaded = (array) $RCMAIL->config->get('message_threading', array()); $oldprefix = '/^' . preg_quote($oldname . $delimiter, '/') . '/'; - foreach (array_keys($a_threaded) as $key) { + foreach ($a_threaded as $key => $val) { if ($key == $oldname) { unset($a_threaded[$key]); $a_threaded[$newname] = true; |