Skip to content
Snippets Groups Projects
Commit f2e3225d authored by Bastian Kuhn's avatar Bastian Kuhn
Browse files

Fixed attachment handling

parent 44feb00d
No related branches found
No related tags found
No related merge requests found
...@@ -123,7 +123,7 @@ if($cfg->allowEmailAttachments()) { ...@@ -123,7 +123,7 @@ if($cfg->allowEmailAttachments()) {
//print_r($attachments); //print_r($attachments);
foreach($attachments as $k=>$attachment){ foreach($attachments as $k=>$attachment){
if($attachment['filename'] && $cfg->canUploadFileType($attachment['filename'])) { if($attachment['filename'] && $cfg->canUploadFileType($attachment['filename'])) {
$ticket->saveAttachment($attachment['filename'],$attachment['body'],$msgid,'M'); $ticket->saveAttachment(array('name' => $attachment['filename'], 'data' => $attachment['body']),$msgid,'M');
} }
} }
} }
......
...@@ -330,7 +330,7 @@ class MailFetcher { ...@@ -330,7 +330,7 @@ class MailFetcher {
if($ticket && $cfg->canUploadFileType($filename) && $cfg->getMaxFileSize()>=$part->bytes) { if($ticket && $cfg->canUploadFileType($filename) && $cfg->getMaxFileSize()>=$part->bytes) {
//extract the attachments...and do the magic. //extract the attachments...and do the magic.
$data=$this->decode($part->encoding, imap_fetchbody($this->mbox,$mid,$index)); $data=$this->decode($part->encoding, imap_fetchbody($this->mbox,$mid,$index));
$ticket->saveAttachment($filename,$data,$ticket->getLastMsgId(),'M'); $ticket->saveAttachment(array('name'=>$filename, 'data'=>$data),$ticket->getLastMsgId(),'M');
return; return;
} }
//TODO: Log failure?? //TODO: Log failure??
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment