mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve #190
This commit is contained in:
parent
f8da8b5135
commit
58d02fa2e7
1 changed files with 12 additions and 9 deletions
|
|
@ -218,27 +218,30 @@ class BodyStructure
|
||||||
|
|
||||||
public function GetHtmlAndPlainParts() : array
|
public function GetHtmlAndPlainParts() : array
|
||||||
{
|
{
|
||||||
$aParts = $this->SearchByCallback(function ($oItem) {
|
$aParts = [];
|
||||||
|
|
||||||
|
$gParts = $this->SearchByCallback(function ($oItem) {
|
||||||
return ('text/html' === $oItem->sContentType || 'text/plain' === $oItem->sContentType)
|
return ('text/html' === $oItem->sContentType || 'text/plain' === $oItem->sContentType)
|
||||||
&& !$oItem->IsAttachBodyPart();
|
&& !$oItem->IsAttachBodyPart();
|
||||||
});
|
});
|
||||||
|
foreach ($gParts as $oPart) {
|
||||||
if ($aParts->valid()) {
|
$aParts[] = $oPart;
|
||||||
return \array_merge([$aParts->current()], \iterator_to_array($aParts));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* No text found, is it encrypted?
|
* No text found, is it encrypted?
|
||||||
* If so, just return that.
|
* If so, just return that.
|
||||||
*/
|
*/
|
||||||
$gEncryptedParts = $this->SearchByContentType('multipart/encrypted');
|
if (!$aParts) {
|
||||||
foreach ($gEncryptedParts as $oPart) {
|
$gEncryptedParts = $this->SearchByContentType('multipart/encrypted');
|
||||||
if ($oPart->IsPgpEncrypted() && $oPart->SubParts()[1]->IsInline()) {
|
foreach ($gEncryptedParts as $oPart) {
|
||||||
return array($oPart->SubParts()[1]);
|
if ($oPart->IsPgpEncrypted() && $oPart->SubParts()[1]->IsInline()) {
|
||||||
|
return array($oPart->SubParts()[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return $aParts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SearchCharset() : string
|
public function SearchCharset() : string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue