Skip to content

Commit d434c95

Browse files
committed
fix: Add null check to avoid trim(null)
1 parent b9be859 commit d434c95

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/Horde/Mail/Rfc822.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ public function parseAddressList($address, array $params = [])
176176
foreach ($address as $val) {
177177
if ($val instanceof Horde_Mail_Rfc822_Object) {
178178
$this->_listob->add($val);
179-
} else {
179+
} elseif ($val !== null) {
180180
$tmp[] = rtrim(trim($val), ',');
181181
}
182182
}
183183

184-
if (!empty($tmp)) {
184+
if ($tmp) {
185185
$this->_data = implode(',', $tmp);
186186
$this->_datalen = strlen($this->_data);
187187
$this->_ptr = 0;

0 commit comments

Comments
 (0)