From 05e9b63f895e32ab1e04b4ca4ff4ca8dac0e0d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 27 Nov 2023 18:13:55 +0100 Subject: [PATCH] Fixed exception, when downloading an attachment file, which does not have a usable extension --- src/Services/Attachments/AttachmentSubmitHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Attachments/AttachmentSubmitHandler.php b/src/Services/Attachments/AttachmentSubmitHandler.php index ac7ec4b5..7a985f4e 100644 --- a/src/Services/Attachments/AttachmentSubmitHandler.php +++ b/src/Services/Attachments/AttachmentSubmitHandler.php @@ -357,7 +357,7 @@ class AttachmentSubmitHandler //Check if we have an extension given $pathinfo = pathinfo($filename); - if ($pathinfo['extension'] !== '') { + if (isset($pathinfo['extension']) && $pathinfo['extension'] !== '') { $new_ext = $pathinfo['extension']; } else { //Otherwise we have to guess the extension for the new file, based on its content $new_ext = $this->mimeTypes->getExtensions($this->mimeTypes->guessMimeType($tmp_path))[0] ?? 'tmp';