summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-08-08 14:09:19 +0200
committerAleksander Machniak <alec@alec.pl>2012-08-08 14:09:19 +0200
commit30833a2ad5a1a67ad1f3b874e9ff1cdab99b849a (patch)
treeed5447713a9492816faaaca571fffb5ab3f13e6d /program/steps/mail
parentcd482ebce6cd776ca294475e2c377e5cc4860388 (diff)
Fix image cid substitution in compose/sendmail
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/compose.inc12
1 files changed, 7 insertions, 5 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 57869d1f7..71a1c0f21 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -666,9 +666,9 @@ function rcmail_prepare_message_body()
if ($isHtml && preg_match('#<img src="\./program/resources/blocked\.gif"#', $body)) {
if ($attachment = rcmail_save_image('program/resources/blocked.gif', 'image/gif')) {
$COMPOSE['attachments'][$attachment['id']] = $attachment;
- $body = preg_replace('#\./program/resources/blocked\.gif#',
- $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$COMPOSE['id'],
- $body);
+ $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
+ $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
+ $body = preg_replace('#\./program/resources/blocked\.gif#', $url, $body);
}
}
@@ -1050,7 +1050,8 @@ function rcmail_write_compose_attachments(&$message, $bodyIsHtml)
if (!$skip && ($attachment = rcmail_save_attachment($message, $pid))) {
$COMPOSE['attachments'][$attachment['id']] = $attachment;
if ($bodyIsHtml && ($part->content_id || $part->content_location)) {
- $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$COMPOSE['id'];
+ $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
+ $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
if ($part->content_id)
$cid_map['cid:'.$part->content_id] = $url;
else
@@ -1075,7 +1076,8 @@ function rcmail_write_inline_attachments(&$message)
if (($part->content_id || $part->content_location) && $part->filename) {
if ($attachment = rcmail_save_attachment($message, $pid)) {
$COMPOSE['attachments'][$attachment['id']] = $attachment;
- $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$COMPOSE['id'];
+ $url = sprintf('%s&_id=%s&_action=display-attachment&_file=rcmfile%s',
+ $RCMAIL->comm_path, $COMPOSE['id'], $attachment['id']);
if ($part->content_id)
$cid_map['cid:'.$part->content_id] = $url;
else