fix: assign new mime type to sanitized uploads if applicable
This commit is contained in:
@@ -141,7 +141,10 @@ class UploadHandler
|
|||||||
$sanitizedFilepath = $this->sanitizer->sanitizeFile($filepath);
|
$sanitizedFilepath = $this->sanitizer->sanitizeFile($filepath);
|
||||||
|
|
||||||
if ($filepath !== $sanitizedFilepath) {
|
if ($filepath !== $sanitizedFilepath) {
|
||||||
$upload->setFilename(basename($sanitizedFilepath));
|
$upload
|
||||||
|
->setFilename(basename($sanitizedFilepath))
|
||||||
|
->setMimeType('application/pdf')
|
||||||
|
;
|
||||||
}
|
}
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user