mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
Small fixes
This commit is contained in:
parent
9b517feca3
commit
c6f098bd2d
2 changed files with 31 additions and 2 deletions
|
|
@ -337,6 +337,26 @@ class BodyStructure
|
||||||
return $aReturn;
|
return $aReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \MailSo\Imap\BodyStructure|null
|
||||||
|
*/
|
||||||
|
public function SearchInlineEncryptedPart()
|
||||||
|
{
|
||||||
|
if ('multipart/encrypted' === \strtolower($this->ContentType()))
|
||||||
|
{
|
||||||
|
$aSearchParts = $this->SearchByCallback(function ($oItem) {
|
||||||
|
return $oItem->IsInline();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (is_array($aSearchParts) && 1 === \count($aSearchParts) && isset($aSearchParts[0]))
|
||||||
|
{
|
||||||
|
return $aSearchParts[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array|null
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
|
|
@ -348,6 +368,15 @@ class BodyStructure
|
||||||
$mResult = $this->SearchPlainParts();
|
$mResult = $this->SearchPlainParts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (null === $mResult || (\is_array($mResult) && 0 === count($mResult)))
|
||||||
|
{
|
||||||
|
$oPart = $this->SearchInlineEncryptedPart();
|
||||||
|
if ($oPart instanceof \MailSo\Imap\BodyStructure)
|
||||||
|
{
|
||||||
|
$mResult = array($oPart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $mResult;
|
return $mResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9592,8 +9592,8 @@ class Actions
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
$sHtml = \preg_replace_callback('/<pre[^>]*>([\s\S\r\n\t]*)<\/pre>/mi', function ($aMatches) {
|
$sHtml = \preg_replace_callback('/(<pre[^>]*>)([\s\S\r\n\t]*?)(<\/pre>)/mi', function ($aMatches) {
|
||||||
return \preg_replace('/[\r\n]+/', '<br />', $aMatches[0]);
|
return \preg_replace('/[\r\n]+/', '<br />', $aMatches[1].\trim($aMatches[2]).$aMatches[3]);
|
||||||
}, $sHtml);
|
}, $sHtml);
|
||||||
|
|
||||||
$mResult['Html'] = 0 === \strlen($sHtml) ? '' : \MailSo\Base\HtmlUtils::ClearHtml(
|
$mResult['Html'] = 0 === \strlen($sHtml) ? '' : \MailSo\Base\HtmlUtils::ClearHtml(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue