diff options
Diffstat (limited to 'program/steps/mail/compose.inc')
-rw-r--r-- | program/steps/mail/compose.inc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 0b18d122a..a6f1d9d11 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -741,8 +741,12 @@ function rcmail_write_compose_attachments(&$message, $bodyIsHtml) if (!$skip && ($attachment = rcmail_save_attachment($message, $pid))) { $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; - if ($bodyIsHtml && $part->content_id) { - $cid_map['cid:'.$part->content_id] = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; + if ($bodyIsHtml && ($part->content_id || $part->content_location)) { + $url = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; + if ($part->content_id) + $cid_map['cid:'.$part->content_id] = $url; + else + $cid_map[$part->content_location] = $url; } } } @@ -760,14 +764,18 @@ function rcmail_write_inline_attachments(&$message) $cid_map = array(); foreach ((array)$message->mime_parts as $pid => $part) { - if ($part->content_id && $part->filename) { + if (($part->content_id || $part->content_location) && $part->filename) { if ($attachment = rcmail_save_attachment($message, $pid)) { $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; - $cid_map['cid:'.$part->content_id] = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; + $url = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; + if ($part->content_id) + $cid_map['cid:'.$part->content_id] = $url; + else + $cid_map[$part->content_location] = $url; } } } - + return $cid_map; } |