-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix MIME guessing of extension from type #6059
Conversation
be14d31
to
97e1aab
Compare
Some edge cases I didn't see. |
97e1aab
to
8a11ced
Compare
'application/x-zip', | ||
'application/zip', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://cdn.jsdelivr.net/gh/jshttp/mime-db@v1.49.0/db.json and https://gitlab.freedesktop.org/xdg/shared-mime-info/-/raw/master/data/freedesktop.org.xml.in which are used by Symfony in updating their MIME types, the first one is the IANA recognized MIME type.
changelog and/or upgrading doc need update to copy |
8a11ced
to
f48f749
Compare
Rebased to add the relevant docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to read through this a couple of times, but I believe the changes still keep the intended security features of those methods in place.
@paulbalandan Thank you! |
Description
Fixes #6046 by relying on the path extension as the
$proposedExtension
argument toConfig\Mimes::guessExtensionFromType()
. The extension is derived usingpathinfo()
However, this fix also changes the behavior of the guessing if a proposed extension is given. Previously, if the proposal is invalid, the guessing ends and returns
null
. Now, this early termination is removed and the guessing is continued using the array mapping of extension to MIME types.Checklist: