summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-04-08 15:48:27 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-04-08 15:48:27 +0200
commitaafbe8efdca6dfef736e623dd5da83d64ae10aef (patch)
tree6ebf8ecd0792cf74ec1fa35303e4b8ece8ba0e01 /program
parent94e797c1fbc5ae1ce3c57bdc5cdaabd3a9f8f911 (diff)
Fix forwarding all ('*') messages of a search set
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js2
-rw-r--r--program/steps/mail/compose.inc9
2 files changed, 8 insertions, 3 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 81829ab13..2a7783fad 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1113,7 +1113,7 @@ function rcube_webmail()
case 'forward':
var uids = this.env.uid ? [this.env.uid] : (this.message_list ? this.message_list.get_selection() : []);
if (uids.length) {
- url = { _forward_uid: this.uids_to_list(uids), _mbox: this.env.mailbox };
+ url = { _forward_uid: this.uids_to_list(uids), _mbox: this.env.mailbox, _search: this.env.search_request };
if (command == 'forward-attachment' || (!props && this.env.forward_attachment) || uids.length > 1)
url._attachment = 1;
this.open_compose_step(url);
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 040d81689..22ebaed8d 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -463,6 +463,11 @@ function rcmail_process_compose_params(&$COMPOSE)
}
}
+ // resolve _forward_uid=* to an absolute list of messages from a search result
+ if ($COMPOSE['param']['forward_uid'] == '*' && is_object($_SESSION['search'][1])) {
+ $COMPOSE['param']['forward_uid'] = $_SESSION['search'][1]->get();
+ }
+
// clean HTML message body which can be submitted by URL
if (!empty($COMPOSE['param']['body'])) {
$COMPOSE['param']['body'] = rcmail_wash_html($COMPOSE['param']['body'], array('safe' => false, 'inline_html' => true), array());
@@ -1259,10 +1264,10 @@ function rcmail_write_forward_attachments()
$index = $storage->index(null, rcmail_sort_column(), rcmail_sort_order());
$COMPOSE['forward_uid'] = $index->get();
}
- else if (strpos($COMPOSE['forward_uid'], ':')) {
+ else if (!is_array($COMPOSE['forward_uid']) && strpos($COMPOSE['forward_uid'], ':')) {
$COMPOSE['forward_uid'] = rcube_imap_generic::uncompressMessageSet($COMPOSE['forward_uid']);
}
- else {
+ else if (is_string($COMPOSE['forward_uid'])) {
$COMPOSE['forward_uid'] = explode(',', $COMPOSE['forward_uid']);
}