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

tnef: Support yet another place for attachment data

parent 68df49b3
No related branches found
No related tags found
No related merge requests found
......@@ -617,7 +617,7 @@ class MailFetcher {
foreach ($this->tnef->attachments as $at) {
$attachments[] = array(
'cid' => @$at->AttachContentId ?: false,
'data' => $at->Data,
'data' => $at,
'type' => @$at->AttachMimeTag ?: false,
'name' => $at->getName(),
);
......@@ -631,7 +631,10 @@ class MailFetcher {
if(!$ost->isFileTypeAllowed($file)) {
$file['error'] = 'Invalid file type (ext) for '.Format::htmlchars($file['name']);
}
elseif (!$file['data']) {
elseif (@$a['data'] instanceof TnefAttachment) {
$file['data'] = $a['data']->getData();
}
else {
// only fetch the body if necessary
$self = $this;
$file['data'] = function() use ($self, $mid, $a) {
......
......@@ -390,7 +390,7 @@ class Mail_Parse {
foreach ($this->tnef->attachments as $at) {
$files[] = array(
'cid' => @$at->AttachContentId ?: false,
'data' => $at->Data,
'data' => $at->getData(),
'type' => @$at->AttachMimeTag ?: false,
'name' => $at->getName(),
);
......
......@@ -209,6 +209,7 @@ class TnefAttribute {
const AttributeReadOnly = 0x10f6;
const CreationTime = 0x3007;
const LastModificationTime = 0x3008;
const AttachDataBinary = 0x3701;
const AttachEncoding = 0x3702;
const AttachExtension = 0x3703;
const AttachFilename = 0x3704;
......@@ -555,6 +556,13 @@ class TnefAttachment extends AbstractTnefObject {
$this->Data = $data;
}
function getData() {
if (isset($this->Data))
return $this->Data;
elseif (isset($this->AttachDataBinary))
return $this->AttachDataBinary;
}
function _setRenderingData($data) {
// Pass
}
......
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