diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-08-08 14:09:19 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-08-08 14:12:15 +0200 |
commit | 1cf428a8af9c1b6df2ca22d937c05397e85bb79a (patch) | |
tree | 88ab0f4e19cc6ed90d4af4331f3e3b7813b74f67 /program | |
parent | 5def04bce0104062640f87f4b9d47f500d24e5be (diff) |
Fix image cid substitution in compose/sendmail
Conflicts:
program/steps/mail/compose.inc
Diffstat (limited to 'program')
-rw-r--r-- | program/steps/mail/compose.inc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index d3b666b1d..ea5b368e1 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -669,9 +669,9 @@ function rcmail_prepare_message_body() if ($isHtml && preg_match('#<img src="\./program/blocked\.gif"#', $body)) { if ($attachment = rcmail_save_image('program/blocked.gif', 'image/gif')) { $COMPOSE['attachments'][$attachment['id']] = $attachment; - $body = preg_replace('#\./program/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/blocked\.gif#', $url, $body); } } @@ -1052,7 +1052,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 @@ -1077,7 +1078,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 |