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

Merge branch 'develop' into develop-next

Conflicts:
	setup/test/tests/stubs.php
parents 1f2b4339 12da45f9
Branches
Tags v1.8.1
No related merge requests found
...@@ -642,7 +642,7 @@ class MailFetcher { ...@@ -642,7 +642,7 @@ class MailFetcher {
foreach ($this->tnef->attachments as $at) { foreach ($this->tnef->attachments as $at) {
$attachments[] = array( $attachments[] = array(
'cid' => @$at->AttachContentId ?: false, 'cid' => @$at->AttachContentId ?: false,
'data' => $at->Data, 'data' => $at,
'type' => @$at->AttachMimeTag ?: false, 'type' => @$at->AttachMimeTag ?: false,
'name' => $at->getName(), 'name' => $at->getName(),
); );
...@@ -656,7 +656,10 @@ class MailFetcher { ...@@ -656,7 +656,10 @@ 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']);
} }
elseif (!$file['data']) { elseif (@$a['data'] instanceof TnefAttachment) {
$file['data'] = $a['data']->getData();
}
else {
// 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) {
......
...@@ -377,7 +377,8 @@ class Mail_Parse { ...@@ -377,7 +377,8 @@ class Mail_Parse {
'type' => strtolower($part->ctype_primary.'/'.$part->ctype_secondary), 'type' => strtolower($part->ctype_primary.'/'.$part->ctype_secondary),
); );
if ($part->ctype_parameters['charset']) if ($part->ctype_parameters['charset']
&& 0 === strcasecmp($part->ctype_primary, 'text'))
$file['data'] = $this->mime_encode($part->body, $file['data'] = $this->mime_encode($part->body,
$part->ctype_parameters['charset']); $part->ctype_parameters['charset']);
else else
...@@ -397,7 +398,7 @@ class Mail_Parse { ...@@ -397,7 +398,7 @@ class Mail_Parse {
foreach ($this->tnef->attachments as $at) { foreach ($this->tnef->attachments as $at) {
$files[] = array( $files[] = array(
'cid' => @$at->AttachContentId ?: false, 'cid' => @$at->AttachContentId ?: false,
'data' => $at->Data, 'data' => $at->getData(),
'type' => @$at->AttachMimeTag ?: false, 'type' => @$at->AttachMimeTag ?: false,
'name' => $at->getName(), 'name' => $at->getName(),
); );
......
...@@ -209,11 +209,13 @@ class TnefAttribute { ...@@ -209,11 +209,13 @@ class TnefAttribute {
const AttributeReadOnly = 0x10f6; const AttributeReadOnly = 0x10f6;
const CreationTime = 0x3007; const CreationTime = 0x3007;
const LastModificationTime = 0x3008; const LastModificationTime = 0x3008;
const AttachDataBinary = 0x3701;
const AttachEncoding = 0x3702; const AttachEncoding = 0x3702;
const AttachExtension = 0x3703; const AttachExtension = 0x3703;
const AttachFilename = 0x3704; const AttachFilename = 0x3704;
const AttachLongFilename = 0x3707; const AttachLongFilename = 0x3707;
const AttachPathname = 0x3708; const AttachPathname = 0x3708;
const AttachTransportName = 0x370c;
const AttachMimeTag = 0x370e; # Mime content-type const AttachMimeTag = 0x370e; # Mime content-type
const AttachContentId = 0x3712; const AttachContentId = 0x3712;
const AttachmentCharset = 0x371b; const AttachmentCharset = 0x371b;
...@@ -234,7 +236,7 @@ class TnefAttribute { ...@@ -234,7 +236,7 @@ class TnefAttribute {
const ReceivedRepresentingSimpleDisplayName = 0x4034; const ReceivedRepresentingSimpleDisplayName = 0x4034;
const CreatorSimpleDisplayName = 0x4038; const CreatorSimpleDisplayName = 0x4038;
const LastModifierSimpleDisplayName = 0x4039; const LastModifierSimpleDisplayName = 0x4039;
const ContentFilterSpmnConfidenceLevel = 0x4076; const ContentFilterSpamConfidenceLevel = 0x4076;
const MessageEditorFormat = 0x5909; const MessageEditorFormat = 0x5909;
static function getName($code) { static function getName($code) {
...@@ -485,7 +487,7 @@ class TnefStreamParser { ...@@ -485,7 +487,7 @@ class TnefStreamParser {
new TnefAttributeStreamReader($info['data'])); new TnefAttributeStreamReader($info['data']));
break; break;
case self::attAttachTransportFilename: case self::attAttachTransportFilename:
$attach->_setFilename($info['data']); $attach->_setFilename(rtrim($info['data'], "\x00"));
break; break;
case self::attAttachData: case self::attAttachData:
$attach->_setData($info['data']); $attach->_setData($info['data']);
...@@ -555,6 +557,13 @@ class TnefAttachment extends AbstractTnefObject { ...@@ -555,6 +557,13 @@ class TnefAttachment extends AbstractTnefObject {
$this->Data = $data; $this->Data = $data;
} }
function getData() {
if (isset($this->Data))
return $this->Data;
elseif (isset($this->AttachDataBinary))
return $this->AttachDataBinary;
}
function _setRenderingData($data) { function _setRenderingData($data) {
// Pass // Pass
} }
...@@ -568,6 +577,8 @@ class TnefAttachment extends AbstractTnefObject { ...@@ -568,6 +577,8 @@ class TnefAttachment extends AbstractTnefObject {
return basename($this->AttachLongFilename); return basename($this->AttachLongFilename);
elseif (isset($this->AttachFilename)) elseif (isset($this->AttachFilename))
return $this->AttachFilename; return $this->AttachFilename;
elseif (isset($this->AttachTransportName))
return $this->AttachTransportName;
else else
return $this->TransportFilename; return $this->TransportFilename;
} }
......
...@@ -28,6 +28,7 @@ class mysqli_stmt { ...@@ -28,6 +28,7 @@ class mysqli_stmt {
class ReflectionClass { class ReflectionClass {
function getMethods() {} function getMethods() {}
function getConstants() {}
} }
class DomNode { class DomNode {
...@@ -92,4 +93,9 @@ class ZipArchive { ...@@ -92,4 +93,9 @@ class ZipArchive {
function statIndex() {} function statIndex() {}
function getFromIndex() {} function getFromIndex() {}
} }
class finfo {
function file() {}
function buffer() {}
}
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment