Skip to content

Commit d227aec

Browse files
author
Sebastian Krätzig
committed
#585: Avoid fetching attachments when they are already downloaded
1 parent 8a7de45 commit d227aec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/PhpImap/DataPartInfo.php

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public function fetch(): string
7979
if (0 === $this->part) {
8080
$this->data = Imap::body($this->mail->getImapStream(), $this->id, $this->options);
8181
} else {
82+
if (null !== $this->data) {
83+
return $this->data;
84+
}
8285
$this->data = Imap::fetchbody($this->mail->getImapStream(), $this->id, $this->part, $this->options);
8386
}
8487

0 commit comments

Comments
 (0)