Compare commits

...

4 commits

Author SHA1 Message Date
Akolzin Dmitry
8dcbff5d4c
Merge pull request #9 from iyzoer/fixes-undefined-index
check date is null
2024-02-08 13:11:18 +03:00
Akolzin Dmitry
cd6af40196 check date is null 2024-02-08 13:09:20 +03:00
Akolzin Dmitry
521f7bcff7
Merge pull request #8 from iyzoer/fixes-undefined-index
fixes undefined property
2024-02-08 12:28:21 +03:00
Akolzin Dmitry
bcaa835898 fixes undefined property 2024-02-08 12:08:07 +03:00
2 changed files with 11 additions and 3 deletions

View file

@ -134,7 +134,9 @@ class Attachment
$this->setFileName($parameters['name']);
}
$this->size = $structure->bytes;
if (property_exists($structure, 'bytes')) {
$this->size = $structure->bytes;
}
$this->mimeType = Message::typeIdToString($structure->type);

View file

@ -253,7 +253,7 @@ class Message
$this->subject = MIME::decode($messageOverview->subject, self::$charset);
}
if (property_exists($messageOverview, 'date')) {
if (property_exists($messageOverview, 'date') && null !== $messageOverview->date) {
$this->date = strtotime($messageOverview->date);
}
@ -764,7 +764,13 @@ class Message
foreach ($addresses as $address) {
if (property_exists($address, 'mailbox') && $address->mailbox != 'undisclosed-recipients') {
$currentAddress = array();
$currentAddress['address'] = $address->mailbox . '@' . $address->host;
$host = '';
if (property_exists($address, 'host')) {
$host = $address->host;
}
$currentAddress['address'] = $address->mailbox . '@' . $host;
if (isset($address->personal)) {
$currentAddress['name'] = MIME::decode($address->personal, self::$charset);
}