From ecb7ae13497837ff79e20520f4f568f992ae5e47 Mon Sep 17 00:00:00 2001 From: Kieffer Navarro Date: Thu, 13 Oct 2022 09:21:16 +0800 Subject: [PATCH] pathinfo php8.1 null check --- src/FileAttachmentField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileAttachmentField.php b/src/FileAttachmentField.php index ddea293..5725ce8 100644 --- a/src/FileAttachmentField.php +++ b/src/FileAttachmentField.php @@ -1298,7 +1298,7 @@ public function getFileClass($filename = null) $name = $this->getName(); $record = $this->getRecord(); - $ext = pathinfo($filename, PATHINFO_EXTENSION); + $ext = pathinfo($filename ?? '', PATHINFO_EXTENSION); $defaultClass = File::get_class_for_file_extension($ext); if(empty($name) || empty($record)) {