Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpFoundation] Make MimeTypeExtensionGuesser case insensitive#31084
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
src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
ro0NL left a comment
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.
ro0NL commentedApr 12, 2019
this needs a patch for master as well, where |
nicolas-grekas commentedApr 14, 2019
@vermeirentony can you add a test case please? |
vermeirentony commentedApr 14, 2019
@nicolas-grekas |
Simperfit commentedApr 15, 2019
@vermeirentony Thanks for the contribution, I think by testcase Nicolas was meaning a test directly in the framework with PHPUnit, could you do that please ? |
vermeirentony commentedApr 15, 2019
@Simperfit sure, will write one later today |
vermeirentony commentedApr 15, 2019
@nicolas-grekas I just added the unit test |
fabpot commentedApr 15, 2019
@vermeirentony Can you squash your commits before merging? Right now, you've used 2 different identities for your commits. You probably need to keep the one here on Github. |
vermeirentony commentedApr 16, 2019
@fabpot squashed the 3 commits into one |
…itive (vermeirentony)This PR was merged into the 3.4 branch.Discussion----------[HttpFoundation] Make MimeTypeExtensionGuesser case insensitive| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->Some mime types have a camelCase word in them.The Apache HTTPD project list items are all lower case.So I suggest making the $mimeType string lowercase while checking the array key.That way, we can keep the list in sync.Example: xlsm file mime type is `application/vnd.ms-excel.sheet.macroEnabled.12`The key that matches the xlsm extension in the `$defaultExtensions` array is `application/vnd.ms-excel.sheet.macroenabled.12`Example xlsm file:https://github.com/vermeirentony/xlsm-exampleCommits-------e294ee6 Make MimeTypeExtensionGuesser case insensitive
nicolas-grekas commentedApr 17, 2019
Thank you@vermeirentony |
Some mime types have a camelCase word in them.
The Apache HTTPD project list items are all lower case.
So I suggest making the $mimeType string lowercase while checking the array key.
That way, we can keep the list in sync.
Example: xlsm file mime type is
application/vnd.ms-excel.sheet.macroEnabled.12The key that matches the xlsm extension in the
$defaultExtensionsarray isapplication/vnd.ms-excel.sheet.macroenabled.12Example xlsm file:
https://github.com/vermeirentony/xlsm-example