Support "multipart/relative" as an alias for "multipart/related" type (#1488886)

pull/54/merge
Aleksander Machniak 12 years ago
parent 43382f7c18
commit cb0f030ae9

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Support "multipart/relative" as an alias for "multipart/related" type (#1488886)
- Display PGP/MIME signature attachments as "Digital Signature" (#1488570) - Display PGP/MIME signature attachments as "Digital Signature" (#1488570)
- Workaround UW-IMAP bug where hierarchy separator is added to the shared folder name (#1488879) - Workaround UW-IMAP bug where hierarchy separator is added to the shared folder name (#1488879)
- Fix version comparisons with -stable suffix (#1488876) - Fix version comparisons with -stable suffix (#1488876)

@ -385,7 +385,7 @@ class rcube_message
// get html/plaintext parts, other add to attachments list // get html/plaintext parts, other add to attachments list
foreach ($structure->parts as $p => $sub_part) { foreach ($structure->parts as $p => $sub_part) {
$sub_mimetype = $sub_part->mimetype; $sub_mimetype = $sub_part->mimetype;
$is_multipart = in_array($sub_mimetype, array('multipart/related', 'multipart/mixed', 'multipart/alternative')); $is_multipart = preg_match('/^multipart\/(related|relative|mixed|alternative)/', $sub_mimetype);
// skip empty text parts // skip empty text parts
if (!$sub_part->size && !$is_multipart) { if (!$sub_part->size && !$is_multipart) {
@ -560,7 +560,7 @@ class rcube_message
continue; continue;
// part belongs to a related message and is linked // part belongs to a related message and is linked
if ($mimetype == 'multipart/related' if (preg_match('/^multipart\/(related|relative)/', $mimetype)
&& ($mail_part->headers['content-id'] || $mail_part->headers['content-location'])) { && ($mail_part->headers['content-id'] || $mail_part->headers['content-location'])) {
if ($mail_part->headers['content-id']) if ($mail_part->headers['content-id'])
$mail_part->content_id = preg_replace(array('/^</', '/>$/'), '', $mail_part->headers['content-id']); $mail_part->content_id = preg_replace(array('/^</', '/>$/'), '', $mail_part->headers['content-id']);
@ -599,7 +599,7 @@ class rcube_message
} }
// if this was a related part try to resolve references // if this was a related part try to resolve references
if ($mimetype == 'multipart/related' && sizeof($this->inline_parts)) { if (preg_match('/^multipart\/(related|relative)/', $mimetype) && sizeof($this->inline_parts)) {
$a_replaces = array(); $a_replaces = array();
$img_regexp = '/^image\/(gif|jpe?g|png|tiff|bmp|svg)/'; $img_regexp = '/^image\/(gif|jpe?g|png|tiff|bmp|svg)/';

Loading…
Cancel
Save