diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-24 13:04:57 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-24 13:04:57 +0000 |
| commit | 33bc6cc7b44fd09d6d887e3ca0428911ac66f67e (patch) | |
| tree | b8229a3f96b905c82cfb66484b21c6b6f9c1d155 /roundcubemail/program/steps/mail | |
| parent | c1b3b039ec49ffd3a9f961728d10fbaffda2a04e (diff) | |
- Allow trash/junk subfolders to be purged (#1485085)
git-svn-id: https://svn.roundcube.net/trunk@1570 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
| -rw-r--r-- | roundcubemail/program/steps/mail/folders.inc | 9 | ||||
| -rw-r--r-- | roundcubemail/program/steps/mail/func.inc | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/folders.inc b/roundcubemail/program/steps/mail/folders.inc index 69f3c0e4c..7fd1f62cc 100644 --- a/roundcubemail/program/steps/mail/folders.inc +++ b/roundcubemail/program/steps/mail/folders.inc @@ -39,8 +39,13 @@ if ($RCMAIL->action=='expunge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_ // clear mailbox else if ($RCMAIL->action=='purge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))) { - // we should only be purging trash and junk - if($mbox == $CONFIG['trash_mbox'] || $mbox == $CONFIG['junk_mbox']) + $delimiter = $IMAP->get_hierarchy_delimiter(); + $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; + $junk_regexp = '/^' . preg_quote($CONFIG['junk_mbox'] . $delimiter, '/') . '/'; + + // we should only be purging trash and junk (or their subfolders) + if ($mbox == $CONFIG['trash_mbox'] || $mbox == $CONFIG['junk_mbox'] + || preg_match($trash_regexp, $mbox) || preg_match($junk_regexp, $mbox)) { $success = $IMAP->clear_mailbox($mbox); diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc index bb5ece5c1..7fbda27b4 100644 --- a/roundcubemail/program/steps/mail/func.inc +++ b/roundcubemail/program/steps/mail/func.inc @@ -57,6 +57,7 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search // set current mailbox in client environment $OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name()); $OUTPUT->set_env('quota', $IMAP->get_capability('quota')); +$OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter()); if ($CONFIG['trash_mbox']) $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']); |
