Rewrite fix as it broke other tests. This fixes my issue and the broken tests.

This commit is contained in:
Bjorn Post 2014-03-11 22:16:43 +01:00
parent 88f43819ee
commit 7b42853eec

View File

@ -432,19 +432,16 @@ class Message
$attachment = new Attachment($this, $structure, $partIdentifier); $attachment = new Attachment($this, $structure, $partIdentifier);
$this->attachments[] = $attachment; $this->attachments[] = $attachment;
} elseif ($structure->type == 0 || $structure->type == 1) { } elseif ($structure->type == 0 || $structure->type == 1) {
if($partIdentifier !== null) { $messageBody = isset($partIdentifier) ?
$section = is_int($structure->ifsubtype) ? (string)$partIdentifier.".".$structure->ifsubtype : $partIdentifier; imap_fetchbody($this->imapStream, $this->uid, $partIdentifier, FT_UID)
$messageBody = imap_fetchbody($this->imapStream, $this->uid, $section, FT_UID); : imap_body($this->imapStream, $this->uid, FT_UID);
} else {
$messageBody = imap_body($this->imapStream, $this->uid, FT_UID);
}
$messageBody = self::decode($messageBody, $structure->encoding); $messageBody = self::decode($messageBody, $structure->encoding);
if (!empty($parameters['charset']) && $parameters['charset'] !== self::$charset) if (!empty($parameters['charset']) && $parameters['charset'] !== self::$charset)
$messageBody = iconv($parameters['charset'], self::$charset, $messageBody); $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)) { if (isset($this->plaintextMessage)) {
$this->plaintextMessage .= PHP_EOL . PHP_EOL; $this->plaintextMessage .= PHP_EOL . PHP_EOL;
} else { } else {
@ -453,7 +450,6 @@ class Message
$this->plaintextMessage .= trim($messageBody); $this->plaintextMessage .= trim($messageBody);
} else { } else {
if (isset($this->htmlMessage)) { if (isset($this->htmlMessage)) {
$this->htmlMessage .= '<br><br>'; $this->htmlMessage .= '<br><br>';
} else { } else {