Skip to content

Commit 0d56102

Browse files
Merge pull request #1715 from nextcloud/bugfix/noid/keep-attachment-type
fix(attachments): Correctly keep intended attachment extension
2 parents d7806b9 + f08547d commit 0d56102

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)