mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-22 03:06:02 +03:00
Rewrite fix as it broke other tests. This fixes my issue and the broken tests.
This commit is contained in:
parent
88f43819ee
commit
7b42853eec
@ -432,19 +432,16 @@ class Message
|
||||
$attachment = new Attachment($this, $structure, $partIdentifier);
|
||||
$this->attachments[] = $attachment;
|
||||
} elseif ($structure->type == 0 || $structure->type == 1) {
|
||||
if($partIdentifier !== null) {
|
||||
$section = is_int($structure->ifsubtype) ? (string)$partIdentifier.".".$structure->ifsubtype : $partIdentifier;
|
||||
$messageBody = imap_fetchbody($this->imapStream, $this->uid, $section, FT_UID);
|
||||
} else {
|
||||
$messageBody = imap_body($this->imapStream, $this->uid, FT_UID);
|
||||
}
|
||||
$messageBody = isset($partIdentifier) ?
|
||||
imap_fetchbody($this->imapStream, $this->uid, $partIdentifier, FT_UID)
|
||||
: imap_body($this->imapStream, $this->uid, FT_UID);
|
||||
|
||||
$messageBody = self::decode($messageBody, $structure->encoding);
|
||||
|
||||
if (!empty($parameters['charset']) && $parameters['charset'] !== self::$charset)
|
||||
$messageBody = iconv($parameters['charset'], self::$charset, $messageBody);
|
||||
|
||||
if (strtolower($structure->subtype) == 'plain' || $structure->type == 1) {
|
||||
if (strtolower($structure->subtype) === 'plain' || ($structure->type == 1 && strtolower($structure->subtype) !== 'alternative')) {
|
||||
if (isset($this->plaintextMessage)) {
|
||||
$this->plaintextMessage .= PHP_EOL . PHP_EOL;
|
||||
} else {
|
||||
@ -453,7 +450,6 @@ class Message
|
||||
|
||||
$this->plaintextMessage .= trim($messageBody);
|
||||
} else {
|
||||
|
||||
if (isset($this->htmlMessage)) {
|
||||
$this->htmlMessage .= '<br><br>';
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user