Added check on Message::processAddressObject()

Added check if the mail addresses are really a email address on  Message::processAddressObject()

The error is when the address is for example: undisclosed-recipients
This commit is contained in:
Gustavo Pilla 2014-10-22 19:30:19 -03:00
parent 501d5d0974
commit 37203c6697

View File

@ -611,10 +611,13 @@ class Message
$outputAddresses = array(); $outputAddresses = array();
if (is_array($addresses)) if (is_array($addresses))
foreach ($addresses as $address) { foreach ($addresses as $address) {
$currentAddress = array(); if (property_exists($address, 'mailbox') && $address->mailbox != 'undisclosed-recipients') {
$currentAddress['address'] = $address->mailbox . '@' . $address->host; $currentAddress = array();
if (isset($address->personal)) $currentAddress['address'] = $address->mailbox . '@' . $address->host;
$currentAddress['name'] = $address->personal; if (isset($address->personal)) {
$currentAddress['name'] = $address->personal;
}
}
$outputAddresses[] = $currentAddress; $outputAddresses[] = $currentAddress;
} }