mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 08:57: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', ''));
|
$sFilename = \MailSo\Base\Utils::SecureFileName($this->GetActionParam('filename', ''));
|
||||||
$aHashes = $this->GetActionParam('hashes', null);
|
$aHashes = $this->GetActionParam('hashes', null);
|
||||||
$oFilesProvider = $this->FilesProvider();
|
$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()) {
|
if (empty($sAction) || !$this->GetCapa(Capa::ATTACHMENTS_ACTIONS) || !$oFilesProvider || !$oFilesProvider->IsActive()) {
|
||||||
return $this->FalseResponse();
|
return $this->FalseResponse();
|
||||||
}
|
}
|
||||||
|
|
@ -31,6 +40,7 @@ trait Attachments
|
||||||
foreach ($aHashes as $sZipHash) {
|
foreach ($aHashes as $sZipHash) {
|
||||||
$aResult = $this->getMimeFileByHash($oAccount, $sZipHash);
|
$aResult = $this->getMimeFileByHash($oAccount, $sZipHash);
|
||||||
if (empty($aResult['data']) && empty($aResult['fileHash'])) {
|
if (empty($aResult['data']) && empty($aResult['fileHash'])) {
|
||||||
|
$this->logWrite('AttachmentsAction data/fileHash not set: ' . \print_r($aResult,1));
|
||||||
$bError = true;
|
$bError = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -151,11 +161,10 @@ trait Attachments
|
||||||
$aValues['fileHash'] = null;
|
$aValues['fileHash'] = null;
|
||||||
if (isset($aValues['data'])) {
|
if (isset($aValues['data'])) {
|
||||||
$aValues['data'] = \MailSo\Base\Utils::UrlSafeBase64Decode($aValues['data']);
|
$aValues['data'] = \MailSo\Base\Utils::UrlSafeBase64Decode($aValues['data']);
|
||||||
} else {
|
} else if (!empty($aValues['folder']) && !empty($aValues['uid'])) {
|
||||||
$sFolder = isset($aValues['folder']) ? (string) $aValues['folder'] : '';
|
$sFolder = (string) $aValues['folder'];
|
||||||
$iUid = isset($aValues['uid']) ? (int) $aValues['uid'] : 0;
|
$iUid = (int) $aValues['uid'];
|
||||||
$sMimeIndex = isset($aValues['mimeIndex']) ? (string) $aValues['mimeIndex'] : '';
|
$sMimeIndex = (string) $aValues['mimeIndex'];
|
||||||
if ($sFolder && $iUid && $sMimeIndex) {
|
|
||||||
$oFileProvider = $this->FilesProvider();
|
$oFileProvider = $this->FilesProvider();
|
||||||
$mResult = $this->MailClient()->MessageMimeStream(
|
$mResult = $this->MailClient()->MessageMimeStream(
|
||||||
function ($rResource, $sContentType, $sFileName, $sMimeIndex = '')
|
function ($rResource, $sContentType, $sFileName, $sMimeIndex = '')
|
||||||
|
|
@ -179,7 +188,6 @@ trait Attachments
|
||||||
$sMimeIndex
|
$sMimeIndex
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $aValues;
|
return $aValues;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue