From c505e59a6d2cf45233c1e0de186b8d6fe9d804ba Mon Sep 17 00:00:00 2001 From: thomascube Date: Fri, 5 Sep 2008 09:29:06 +0000 Subject: Respect Content-Location headers in multipart/related messages (#1484946) --- program/include/rcube_message.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'program/include/rcube_message.php') diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php index 1e3bc7f7e..329c39049 100644 --- a/program/include/rcube_message.php +++ b/program/include/rcube_message.php @@ -356,6 +356,10 @@ class rcube_message $mail_part->content_id = preg_replace(array('/^$/'), '', $mail_part->headers['content-id']); $this->inline_parts[] = $mail_part; } + else if ($message_ctype_secondary == 'related' && $mail_part->headers['content-location']) { + $mail_part->content_location = $mail_part->headers['content-base'] . $mail_part->headers['content-location']; + $this->inline_parts[] = $mail_part; + } // is regular attachment else { if (!$mail_part->filename) @@ -370,7 +374,11 @@ class rcube_message $a_replaces = array(); foreach ($this->inline_parts as $inline_object) { - $a_replaces['cid:'.$inline_object->content_id] = $this->get_part_url($inline_object->mime_id); + $part_url = $this->get_part_url($inline_object->mime_id); + if ($inline_object->content_id) + $a_replaces['cid:'.$inline_object->content_id] = $part_url; + if ($inline_object->content_location) + $a_replaces[$inline_object->content_location] = $part_url; } // add replace array to each content part -- cgit v1.2.3