-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Now that the Mime component is standalone, can't we skip the dependency on HttpFoundation instead? |
cdc74bf to
4c06e60
Compare
4c06e60 to
df554cd
Compare
|
@nicolas-grekas Done |
|
What about considering it as a bugfix? |
cf33702 to
3577b28
Compare
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 |
|
I would suggest targeting 4.4 and forget about 3.4. |
3577b28 to
62ade6a
Compare
84357d4 to
05416a2
Compare
|
Status: Ready for review |
05416a2 to
2a720eb
Compare
|
I pushed a CS change. The code looks good, but the tests need some love, see failures on appveyor when the finfo extension is not enabled. |
35fc85e to
09dc302
Compare
09dc302 to
4728833
Compare
|
I reverted the changes to the tests to use mocks again, and just changed the ordering of the checks |
|
Thank you @pierredup. |
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.