-
-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Description
Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in
..\imapengine\vendor\directorytree\imapengine\src\Attachment.php on line 84Environment
- PHP version: 8.4.3
- ImapEngine version: latest
- IMAP server: own (linux/plesk)
When using $extension = $attachment->extension(); without checking before if a filename is given, this message/error will be shown.
This happens e.g. at messages which have attachments, but they have no extension.
Like: Delivery Report and Undelivered Message which are added by (my) mailserver (maybe others will add such also ..).
So by doing like:
$filename = $attachment->filename();
// check if filename exists, otherwise following functions will show error!
if ($filename) {
// get extension
$extension = $attachment->extension();Of course such a check could be done also inside the function
public function extension(): ?stringlike:
public function extension(): ?string
{
if (!$this->filename) {
return '';
}Metadata
Metadata
Assignees
Labels
No labels