Skip to content
Snippets Groups Projects
Commit 2be82871 authored by kaushik p's avatar kaushik p
Browse files

#Fixes::157996168::kaushik::Repetetive images received in inline attachments mail sent

parent 567ccfad
No related branches found
No related tags found
No related merge requests found
......@@ -276,7 +276,8 @@ class MailManager_Message_Model extends Vtiger_MailRecord {
if(file_exists($saved_filename)) $fileContent = @fread(fopen($saved_filename, "r"), filesize($saved_filename));
}
if(!empty($atResultRow['cid'])) {
$this->_inline_attachments[] = array('filename'=>$atResultRow['aname'], 'cid'=>$atResultRow['cid']);
// In _inline_attachments passing 'atid' => $atResultRow['attachid'];
$this->_inline_attachments[] = array('filename'=>$atResultRow['aname'], 'cid'=>$atResultRow['cid'], 'atid' => $atResultRow['attachid']);
}
$filePath = $atResultRow['path'].$atResultRow['attachid'].'_'.sanitizeUploadFileName($atResultRow['aname'], vglobal('upload_badext'));
$fileSize = $this->convertFileSize(filesize($filePath));
......
......@@ -42,9 +42,13 @@ class MailManager_Mail_View extends MailManager_Abstract_View {
$cid = $att['cid'];
$attch_name = Vtiger_MailRecord::__mime_decode($att['filename']);
$id = $mail->muid();
$src = "index.php?module=MailManager&view=Index&_operation=mail&_operationarg=attachment_dld&_muid=$id&_atname=".urlencode($attch_name);
// attachment id from $att
$attId = $att['atid'];
// passing in the url :
$src = "index.php?module=MailManager&view=Index&_operation=mail&_operationarg=attachment_dld&_muid=$id&_atid=$attId&_atname=".urlencode($attch_name);
$body = preg_replace('/cid:'.$cid.'/', $src, $body);
$inline_cid[$attch_name] = $cid;
// before we used to pass $attach_name, changed to $att['atid'] or $attId
$inline_cid[$attId] = $cid;
}
}
$viewer->assign('INLINE_ATT', $inline_cid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment