* Tracker: fix inline images imported from mail get always overridden by the first inline image in the list

This commit is contained in:
Hadi Nategh 2018-05-15 18:11:10 +02:00
parent 6eb3ca2592
commit 9f0b8754a3

View File

@ -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)
{