From f08547daf85677a1c0a35bd118a279dccb7981c0 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 19 Jan 2026 10:23:47 +0100 Subject: [PATCH] fix(attachments): Correctly keep intended attachment extension Signed-off-by: Joas Schilling --- lib/Service/NotesService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Service/NotesService.php b/lib/Service/NotesService.php index dca19508f..1716bc106 100644 --- a/lib/Service/NotesService.php +++ b/lib/Service/NotesService.php @@ -260,7 +260,8 @@ public function createImage(string $userId, int $noteid, $fileDataArray) { } catch (\Exception $e) { $filename = uniqid(); } - $filename = $filename . '.' . explode('.', $fileDataArray['name'])[1]; + $parts = explode('.', $fileDataArray['name']); + $filename .= '.' . end($parts); if ($fileDataArray['tmp_name'] === '') { throw new ImageNotWritableException();