Description
Symfony version(s) affected: Probably >= 4.1.0, reproduced on 4.2.7
Description
If you have a file upload form and a user uploads a zero byte file, Symfony raises a deprecation notice.
Passing a size as 4th argument to the constructor of "Symfony\Component\HttpFoundation\File\UploadedFile" is deprecated since Symfony 4.1.
The root cause is line 68.
symfony/src/Symfony/Component/HttpFoundation/File/UploadedFile.php
Lines 68 to 72 in 6122c79
How to reproduce
Use the Form component, add a FileType
input and upload a 0 byte file, deprecation notice should be logged.
Possible Solution
Given that any file size of 0-8 bytes should cause the same issue (as the UPLOAD_ERR_
constants have that range of values), I'm not sure it can be fixed. Perhaps the best solution is to update the message to document this edge case.