diff --git a/include/class.mailer.php b/include/class.mailer.php index 0e89ddad588bb0a4b00e210ada0bde36abe90fd9..a57f8d7be1ac5b7e15f79fd3d8430cbfd2d58819 100644 --- a/include/class.mailer.php +++ b/include/class.mailer.php @@ -78,11 +78,14 @@ class Mailer { } function addAttachment($attachment) { - $this->attachments[] = $attachment; + // XXX: This looks too assuming; however, the attachment processor + // in the ::send() method seems hard coded to expect this format + $this->attachments[$attachment['file_id']] = $attachment; } function addAttachments($attachments) { - $this->attachments = array_merge($this->attachments, $attachments); + foreach ($attachments as $a) + $this->addAttachment($a); } function send($to, $subject, $message, $options=null) { @@ -180,8 +183,6 @@ class Mailer { $mime->addAttachment($file->getData(), $file->getType(), $file->getName(),false); } - elseif($attachment['file'] && file_exists($attachment['file']) && is_readable($attachment['file'])) - $mime->addAttachment($attachment['file'],$attachment['type'],$attachment['name']); } } diff --git a/include/class.ticket.php b/include/class.ticket.php index 21d80ad0bfe76470f413275760ea2e722f1310d5..616656207b4f57e6c7f37dc59907cd9419f04fbf 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1515,8 +1515,6 @@ class Ticket { if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator())) $msg['body'] = "<p style=\"display:none\">$tag<p>".$msg['body']; - //Set attachments if emailing. - $attachments = $cfg->emailAttachments()?$response->getAttachments():array(); $options = array( 'inreplyto' => $response->getEmailMessageId(), 'references' => $response->getEmailReferences());