Skip to content

Commit

Permalink
Fix invalid X-Draft-Info on forwarded message draft (#1489587)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Feb 11, 2014
1 parent c4c3e78 commit e089c5a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG Roundcube Webmail
- Fix issue when default_addressbook option is set to integer value (#1489407)
- Fix Opera > 15 detection (#1489562)
- Fix security issue in DomainFactory driver of Password plugin
- Fix invalid X-Draft-Info on forwarded message draft (#1489587)

RELEASE 1.0-rc
--------------
Expand Down
5 changes: 4 additions & 1 deletion program/lib/Roundcube/rcube_storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ abstract function expunge_message($uids, $folder = null, $clear_cache = true);
/**
* Parse message UIDs input
*
* @param mixed $uids UIDs array or comma-separated list or '*' or '1:*'
* @param mixed $uids UIDs array or comma-separated list or '*' or '1:*'
*
* @return array Two elements array with UIDs converted to list and ALL flag
*/
Expand All @@ -633,6 +633,9 @@ protected function parse_uids($uids)
if (is_array($uids)) {
$uids = join(',', $uids);
}
else if (strpos($uids, ':')) {
$uids = join(',', rcube_imap_generic::uncompressMessageSet($uids));
}

if (preg_match('/[^0-9,]/', $uids)) {
$uids = '';
Expand Down
3 changes: 3 additions & 0 deletions program/steps/mail/compose.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,9 @@ 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'], ':')) {
$COMPOSE['forward_uid'] = rcube_imap_generic::uncompressMessageSet($COMPOSE['forward_uid']);
}
else {
$COMPOSE['forward_uid'] = explode(',', $COMPOSE['forward_uid']);
}
Expand Down
2 changes: 1 addition & 1 deletion program/steps/mail/sendmail.inc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ if (!empty($COMPOSE['reply_uid']) && $savedraft) {
$headers['X-Draft-Info'] = array('type' => 'reply', 'uid' => $COMPOSE['reply_uid']);
}
else if (!empty($COMPOSE['forward_uid']) && $savedraft) {
$headers['X-Draft-Info'] = array('type' => 'forward', 'uid' => $COMPOSE['forward_uid']);
$headers['X-Draft-Info'] = array('type' => 'forward', 'uid' => rcube_imap_generic::compressMessageSet($COMPOSE['forward_uid']));
}

if (!empty($COMPOSE['reply_msgid'])) {
Expand Down

0 comments on commit e089c5a

Please sign in to comment.