Skip to content

Commit 230e504

Browse files
committed
Prevent empty attachments Webklex#37
1 parent a069c88 commit 230e504

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
88
### Fixed
99
- Text/Html body fetched as attachment if subtype is null #34
1010
- Potential header overwriting through header extensions #35
11+
- Prevent empty attachments #37
1112

1213
### Added
1314
- NaN

src/Message.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ protected function fetchAttachment($part) {
475475

476476
$oAttachment = new Attachment($this, $part);
477477

478-
if ($oAttachment->getName() !== null) {
478+
if ($oAttachment->getName() !== null && $oAttachment->getSize() > 0) {
479479
if ($oAttachment->getId() !== null) {
480480
$this->attachments->put($oAttachment->getId(), $oAttachment);
481481
} else {

0 commit comments

Comments
 (0)