upload
upload copied to clipboard
Access violation in mime type map
https://github.com/FriendsOfFlarum/upload/blob/60bd5ead414893b39d03dd0748e54dae190afded/src/Commands/UploadHandler.php#L87
I think there should be a check for the key 'mime' in the map uploadFileData before accessing the value since the map returned from getFileType() might be empty. I'm getting an error when uploading some png file:
[error] 321#321: *176 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: mime in /opt/flarum/vendor/fof/upload/src/Commands/UploadHandler.php on line 87" while reading response header from upstream
I don't know whether its a valid situation or not to have files with unknown mime types. Or maybe my setup is not well built thus it cannot read mime types of images.
I can't find where the documentation for the mimeDetector says how we are supposed to read that array https://github.com/SoftCreatR/php-mime-detector#usage
@imorland you might want to take a look at this ?