summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-05-27 14:08:48 +0000
committeralecpl <alec@alec.pl>2010-05-27 14:08:48 +0000
commit8f2b4639816d698ebb1fa805551984a897a06ec4 (patch)
tree8ade94064c97d4c567775b4ffc355c33f1eaffcf /program
parentc973abfd8b79e9fe96eb86398dae7ec97db69224 (diff)
- handle properly inline images without content_id but with content_location
Diffstat (limited to 'program')
-rw-r--r--program/steps/mail/compose.inc18
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;
}