"It is extracted from the original file name that was uploaded. Then it should not be considered as a safe value." it is not safe when file is uploaded
Screenshots
Solution
Possible solution would be changing this line to:
$this->extension = strtolower($file->getClientOriginalExtension() ?: $file->guessExtension());
or better
$this->extension = strtolower($file->guessExtension())
Describe the bug When uploading file from request:
Stored file in
nova_media_library
will have name without extensionphps5zvfw-1654000439eZm9z.
As noted in https://devdocs.io/symfony~3.1/symfony/component/httpfoundation/file/uploadedfile#method_getClientOriginalExtension
Screenshots
Solution
Possible solution would be changing this line to:
$this->extension = strtolower($file->getClientOriginalExtension() ?: $file->guessExtension());
or better$this->extension = strtolower($file->guessExtension())