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

Merge branch 'develop' into develop-next

parents fa564a74 68df49b3
No related branches found
No related tags found
No related merge requests found
...@@ -586,14 +586,18 @@ class MailFetcher { ...@@ -586,14 +586,18 @@ class MailFetcher {
&& ($attachments = $this->getAttachments($struct))) { && ($attachments = $this->getAttachments($struct))) {
foreach ($attachments as $i=>$info) { foreach ($attachments as $i=>$info) {
if (0 === strcasecmp('application/ms-tnef', $info['type'])) { if (0 === strcasecmp('application/ms-tnef', $info['type'])) {
$data = $this->decode(imap_fetchbody($self->mbox, try {
$mid, $info['index']), $info['encoding']); $data = $this->decode(imap_fetchbody($this->mbox,
$tnef = new TnefStreamParser($data); $mid, $info['index']), $info['encoding']);
$this->tnef = $tnef->getMessage(); $tnef = new TnefStreamParser($data);
// No longer considered an attachment $this->tnef = $tnef->getMessage();
unset($attachments[$i]); // No longer considered an attachment
// There should only be one of these unset($attachments[$i]);
break; // There should only be one of these
break;
} catch (TnefException $ex) {
// Noop -- winmail.dat remains an attachment
}
} }
} }
} }
...@@ -652,7 +656,7 @@ class MailFetcher { ...@@ -652,7 +656,7 @@ class MailFetcher {
if(!$ost->isFileTypeAllowed($file)) { if(!$ost->isFileTypeAllowed($file)) {
$file['error'] = 'Invalid file type (ext) for '.Format::htmlchars($file['name']); $file['error'] = 'Invalid file type (ext) for '.Format::htmlchars($file['name']);
} }
else { elseif (!$file['data']) {
// only fetch the body if necessary // only fetch the body if necessary
$self = $this; $self = $this;
$file['data'] = function() use ($self, $mid, $a) { $file['data'] = function() use ($self, $mid, $a) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment