Be more specific when fetching body sections, references #39

This commit is contained in:
Bjorn Post 2014-03-11 20:17:02 +01:00
parent 4432bd110a
commit 88f43819ee

View File

@ -432,10 +432,12 @@ 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);