mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-30 05:24:28 +02:00
Fixed exception, when downloading an attachment file, which does not have a usable extension
This commit is contained in:
parent
da0845c11c
commit
05e9b63f89
1 changed files with 1 additions and 1 deletions
|
@ -357,7 +357,7 @@ class AttachmentSubmitHandler
|
||||||
|
|
||||||
//Check if we have an extension given
|
//Check if we have an extension given
|
||||||
$pathinfo = pathinfo($filename);
|
$pathinfo = pathinfo($filename);
|
||||||
if ($pathinfo['extension'] !== '') {
|
if (isset($pathinfo['extension']) && $pathinfo['extension'] !== '') {
|
||||||
$new_ext = $pathinfo['extension'];
|
$new_ext = $pathinfo['extension'];
|
||||||
} else { //Otherwise we have to guess the extension for the new file, based on its content
|
} 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';
|
$new_ext = $this->mimeTypes->getExtensions($this->mimeTypes->guessMimeType($tmp_path))[0] ?? 'tmp';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue