Skip to content

Commit 4995a3e

Browse files
committed
Missing variable check added to prevent error while parsing an address
Webklex/laravel-imap#356
1 parent 8354f23 commit 4995a3e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
77
## [UNRELEASED]
88
### Fixed
99
- Prevent text bodies from being fetched as attachment #27
10+
- Missing variable check added to prevent exception while parsing an address [webklex/laravel-imap #356](https://github.com/Webklex/laravel-imap/issues/356)
1011

1112
### Added
1213
- NaN
1314

1415
### Affected Classes
1516
- [Message::class](src/Message.php)
17+
- [Header::class](src/Header.php)
1618

1719
### Breaking changes
1820
- Text bodies might no longer get fetched as attachment

src/Header.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ private function extractAddresses($header) {
474474
private function parseAddresses($list) {
475475
$addresses = [];
476476

477+
if (is_array($list) === false) {
478+
return $addresses;
479+
}
480+
477481
foreach ($list as $item) {
478482
$address = (object) $item;
479483

0 commit comments

Comments
 (0)