From ce00940822b9211267840c1f540d19a7032b5fe5 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 4 Apr 2022 16:33:11 +0200 Subject: [PATCH] fix notice "Notice: Undefined property: stdClass::$dparameters" --- src/Core/Message/Attachment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Message/Attachment.php b/src/Core/Message/Attachment.php index a6f0e76..f1d7916 100644 --- a/src/Core/Message/Attachment.php +++ b/src/Core/Message/Attachment.php @@ -226,7 +226,7 @@ class Attachment $this->attachment['ifdparameters'] = (isset($this->part->ifdparameters)) ? $this->part->ifdparameters : false; $this->attachment['ifparameters'] = (isset($this->part->ifparameters)) ? $this->part->ifparameters : false; - if (\is_array($this->part->dparameters)) { + if (isset($this->part->dparameters) && \is_array($this->part->dparameters)) { foreach ($this->part->dparameters as $obj) { if (\in_array(mb_strtolower($obj->attribute), ['filename', 'name'], true)) { $this->attachment[mb_strtolower($obj->attribute)] = pathinfo($obj->value, PATHINFO_FILENAME); @@ -235,7 +235,7 @@ class Attachment } } - if (\is_array($this->part->parameters)) { + if (isset($this->part->parameters) && \is_array($this->part->parameters)) { foreach ($this->part->parameters as $obj) { if (\in_array(mb_strtolower($obj->attribute), ['filename', 'name'], true)) { $this->attachment[mb_strtolower($obj->attribute)] = pathinfo($obj->value, PATHINFO_FILENAME);