mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 09:27:03 +03:00
Resolve #1514
This commit is contained in:
parent
b45459d645
commit
3513669412
1 changed files with 34 additions and 26 deletions
|
|
@ -17,6 +17,15 @@ trait Attachments
|
|||
$sFilename = \MailSo\Base\Utils::SecureFileName($this->GetActionParam('filename', ''));
|
||||
$aHashes = $this->GetActionParam('hashes', null);
|
||||
$oFilesProvider = $this->FilesProvider();
|
||||
if (empty($sAction)) {
|
||||
$this->logWrite('AttachmentsAction target not set');
|
||||
}
|
||||
if (!$this->GetCapa(Capa::ATTACHMENTS_ACTIONS)) {
|
||||
$this->logWrite('AttachmentsAction disabled');
|
||||
}
|
||||
if (!$oFilesProvider || !$oFilesProvider->IsActive()) {
|
||||
$this->logWrite('AttachmentsAction FilesProvider inactive');
|
||||
}
|
||||
if (empty($sAction) || !$this->GetCapa(Capa::ATTACHMENTS_ACTIONS) || !$oFilesProvider || !$oFilesProvider->IsActive()) {
|
||||
return $this->FalseResponse();
|
||||
}
|
||||
|
|
@ -31,6 +40,7 @@ trait Attachments
|
|||
foreach ($aHashes as $sZipHash) {
|
||||
$aResult = $this->getMimeFileByHash($oAccount, $sZipHash);
|
||||
if (empty($aResult['data']) && empty($aResult['fileHash'])) {
|
||||
$this->logWrite('AttachmentsAction data/fileHash not set: ' . \print_r($aResult,1));
|
||||
$bError = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -151,11 +161,10 @@ trait Attachments
|
|||
$aValues['fileHash'] = null;
|
||||
if (isset($aValues['data'])) {
|
||||
$aValues['data'] = \MailSo\Base\Utils::UrlSafeBase64Decode($aValues['data']);
|
||||
} else {
|
||||
$sFolder = isset($aValues['folder']) ? (string) $aValues['folder'] : '';
|
||||
$iUid = isset($aValues['uid']) ? (int) $aValues['uid'] : 0;
|
||||
$sMimeIndex = isset($aValues['mimeIndex']) ? (string) $aValues['mimeIndex'] : '';
|
||||
if ($sFolder && $iUid && $sMimeIndex) {
|
||||
} else if (!empty($aValues['folder']) && !empty($aValues['uid'])) {
|
||||
$sFolder = (string) $aValues['folder'];
|
||||
$iUid = (int) $aValues['uid'];
|
||||
$sMimeIndex = (string) $aValues['mimeIndex'];
|
||||
$oFileProvider = $this->FilesProvider();
|
||||
$mResult = $this->MailClient()->MessageMimeStream(
|
||||
function ($rResource, $sContentType, $sFileName, $sMimeIndex = '')
|
||||
|
|
@ -179,7 +188,6 @@ trait Attachments
|
|||
$sMimeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $aValues;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue