Fix listing the same attachment multiple times on forwarded messages

pull/6429/head
Aleksander Machniak 6 years ago
parent 2537697693
commit 5cdb54221f

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix listing the same attachment multiple times on forwarded messages
- Fix compatibility with MySQL 8 - error on 'system' table use
RELEASE 1.4-beta

@ -948,9 +948,11 @@ class rcube_message
private function add_part($part, $type = null)
{
if ($this->check_context($part)) {
// It may happen that we add the same part to the array many times
// use part ID index to prevent from duplicates
switch ($type) {
case 'inline': $this->inline_parts[] = $part; break;
case 'attachment': $this->attachments[] = $part; break;
case 'inline': $this->inline_parts[(string) $part->mime_id] = $part; break;
case 'attachment': $this->attachments[(string) $part->mime_id] = $part; break;
default: $this->parts[] = $part; break;
}
}

Loading…
Cancel
Save