Closed mathieudz closed 6 years ago
This should fix https://github.com/php-pm/php-pm-httpkernel/issues/111
Indeed, that's the error I had. How to reproduce: add a file input to a form and submit without specifying a file. HttpKernel replaces the React file by null and Symfony will not accept it.
Much appreciated, thank you!
Symfony 4.1 fails on uploaded files that are null: they must be array or UploadedFile. UploadedFile can only be used for actual files. Solution is to pass the uploaded file as array instead.
The array cannot be passed for actual uploaded files because Symfony will not trust the files because they were not created by PHP core.
A better solution would be to let Symfony accept null files (see implementation of FileBag).