Skip to content
Snippets Groups Projects
Commit 2d691db3 authored by Jared Hancock's avatar Jared Hancock
Browse files

Don't double-attach email inline attachments

parent 0f70e88e
Branches 1.11.x
No related tags found
No related merge requests found
......@@ -426,7 +426,14 @@ Class ThreadEntry {
if(!($fileId=is_numeric($file)?$file:AttachmentFile::save($file)))
return 0;
$sql ='INSERT INTO '.TICKET_ATTACHMENT_TABLE.' SET created=NOW() '
// TODO: Add a unique index to TICKET_ATTACHMENT_TABLE (file_id,
// ticket_id), and remove this block
if ($id = db_result(db_query('SELECT attach_id FROM '.TICKET_ATTACHMENT_TABLE
.' WHERE file_id='.db_input($fileId).' AND ticket_id='
.db_input($this->getTicketId()))))
return $id;
$sql ='INSERT IGNORE INTO '.TICKET_ATTACHMENT_TABLE.' SET created=NOW() '
.' ,file_id='.db_input($fileId)
.' ,ticket_id='.db_input($this->getTicketId())
.' ,ref_id='.db_input($this->getId())
......
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