Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] Use Mime component to determine mime type for file validator#36868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedMay 19, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Now that the Mime component is standalone, can't we skip the dependency on HttpFoundation instead? |
cdc74bf to4c06e60Compare4c06e60 todf554cdComparepierredup commentedMay 19, 2020
@nicolas-grekas Done |
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedMay 19, 2020
What about considering it as a bugfix? |
cf33702 to3577b28Comparepierredup commentedMay 19, 2020
I wasn't sure if it counted as a bugfix or new feature. When in doubt, I just consider something a new feature :) But I'm not sure if a bugfix against 3.4 can use the Mime component, so should I create a new PR for 3.4 and have the original exception message for |
nicolas-grekas commentedMay 19, 2020
I would suggest targeting 4.4 and forget about 3.4. |
3577b28 to62ade6aCompareUh oh!
There was an error while loading.Please reload this page.
84357d4 to05416a2Comparepierredup commentedMay 29, 2020
Status: Ready for review |
05416a2 to2a720ebComparenicolas-grekas commentedMay 29, 2020
I pushed a CS change. The code looks good, but the tests need some love, seefailures on appveyor when the finfo extension is not enabled. |
35fc85e to09dc302Compare09dc302 to4728833Comparepierredup commentedMay 29, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I reverted the changes to the tests to use mocks again, and just changed the ordering of the checks |
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedMay 30, 2020
Thank you@pierredup. |
Uh oh!
There was an error while loading.Please reload this page.
When validating the mime type for a file, the Validator component relies on the
Symfony\Component\HttpFoundation\File\Fileclass, but if the HttpFoundation component is not installed, then you just get the errorThis PR uses the Mime component to get the mime type for a file and throws an exception if the Mime component is not installed.