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
No related branches found
No related tags found
No related merge requests found
......@@ -642,7 +642,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(),
);
......@@ -656,7 +656,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) {
......
......@@ -377,7 +377,8 @@ class Mail_Parse {
'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,
$part->ctype_parameters['charset']);
else
......@@ -397,7 +398,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,11 +209,13 @@ class TnefAttribute {
const AttributeReadOnly = 0x10f6;
const CreationTime = 0x3007;
const LastModificationTime = 0x3008;
const AttachDataBinary = 0x3701;
const AttachEncoding = 0x3702;
const AttachExtension = 0x3703;
const AttachFilename = 0x3704;
const AttachLongFilename = 0x3707;
const AttachPathname = 0x3708;
const AttachTransportName = 0x370c;
const AttachMimeTag = 0x370e; # Mime content-type
const AttachContentId = 0x3712;
const AttachmentCharset = 0x371b;
......@@ -234,7 +236,7 @@ class TnefAttribute {
const ReceivedRepresentingSimpleDisplayName = 0x4034;
const CreatorSimpleDisplayName = 0x4038;
const LastModifierSimpleDisplayName = 0x4039;
const ContentFilterSpmnConfidenceLevel = 0x4076;
const ContentFilterSpamConfidenceLevel = 0x4076;
const MessageEditorFormat = 0x5909;
static function getName($code) {
......@@ -485,7 +487,7 @@ class TnefStreamParser {
new TnefAttributeStreamReader($info['data']));
break;
case self::attAttachTransportFilename:
$attach->_setFilename($info['data']);
$attach->_setFilename(rtrim($info['data'], "\x00"));
break;
case self::attAttachData:
$attach->_setData($info['data']);
......@@ -555,6 +557,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
}
......@@ -568,6 +577,8 @@ class TnefAttachment extends AbstractTnefObject {
return basename($this->AttachLongFilename);
elseif (isset($this->AttachFilename))
return $this->AttachFilename;
elseif (isset($this->AttachTransportName))
return $this->AttachTransportName;
else
return $this->TransportFilename;
}
......
......@@ -28,6 +28,7 @@ class mysqli_stmt {
class ReflectionClass {
function getMethods() {}
function getConstants() {}
}
class DomNode {
......@@ -92,4 +93,9 @@ class ZipArchive {
function statIndex() {}
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