thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.72k stars 2.67k forks source link

500 and incorrect MIME type detection for file without extension in VoyagerMediaController #5734

Open Wampirusy opened 1 year ago

Wampirusy commented 1 year ago

Laravel version

9.45.1

PHP version

8.2.1

Voyager version

1.6

Database

mariadb:10.1.14

Description

  1. VoyagerMediaController@files falls with 500 error if you have files without extension in the browsed folder: image

  2. javascript throws TypeError on files with undefined extensions: image image

Steps to reproduce

  1. store file with "filename" filename to the storage, browse it's folder with VoyagerMediaController, get an exception on POST media/files
  2. store file with "filename.abc" filename to the storage, browse it's folder with VoyagerMediaController, get an javascript exception in the console

Expected behavior

1 & 2: get the list of files and folders, files with undefined filetypes has a default type

Screenshots

No response

Additional context

my suggestion: https://github.com/the-control-group/voyager/pull/5733