Skip to content

Commit f08547d

Browse files
committed
fix(attachments): Correctly keep intended attachment extension
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent d7806b9 commit f08547d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/Service/NotesService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ public function createImage(string $userId, int $noteid, $fileDataArray) {
260260
} catch (\Exception $e) {
261261
$filename = uniqid();
262262
}
263-
$filename = $filename . '.' . explode('.', $fileDataArray['name'])[1];
263+
$parts = explode('.', $fileDataArray['name']);
264+
$filename .= '.' . end($parts);
264265

265266
if ($fileDataArray['tmp_name'] === '') {
266267
throw new ImageNotWritableException();

0 commit comments

Comments
 (0)