mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-25 04:26:02 +03:00
Be more specific when fetching body sections, references #39
This commit is contained in:
parent
4432bd110a
commit
88f43819ee
@ -432,10 +432,12 @@ class Message
|
||||
$attachment = new Attachment($this, $structure, $partIdentifier);
|
||||
$this->attachments[] = $attachment;
|
||||
} elseif ($structure->type == 0 || $structure->type == 1) {
|
||||
|
||||
$messageBody = isset($partIdentifier) ?
|
||||
imap_fetchbody($this->imapStream, $this->uid, $partIdentifier, FT_UID)
|
||||
: imap_body($this->imapStream, $this->uid, FT_UID);
|
||||
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 = self::decode($messageBody, $structure->encoding);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user