From 9f0b8754a357130569ec0da5ea3da34f25f5f0c6 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 15 May 2018 18:11:10 +0200 Subject: [PATCH] * Tracker: fix inline images imported from mail get always overridden by the first inline image in the list --- mail/inc/class.mail_integration.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mail/inc/class.mail_integration.inc.php b/mail/inc/class.mail_integration.inc.php index 66f47a5546..a1fbd14443 100644 --- a/mail/inc/class.mail_integration.inc.php +++ b/mail/inc/class.mail_integration.inc.php @@ -366,9 +366,16 @@ class mail_integration { // Fix inline images if($mailcontent['html_message'] && $attachment['cid'] && $data_attachments[$key]['egw_data']) { - $link_callback = function($cid) use($data_attachments, $key) + $link_callback = function($cid) use($data_attachments, $attachment, $key) { - return self::INLINE_PREFIX.$data_attachments[$key]['egw_data'].'" title="['.$data_attachments[$key]['name'].']'; + if ($attachment['cid'] == $cid) + { + return self::INLINE_PREFIX.$data_attachments[$key]['egw_data'].'" title="['.$data_attachments[$key]['name'].']'; + } + else + { + return "cid:".$cid; + } }; foreach(array('src','url','background') as $type) {