Skip to content

[Validator] Highlight extensions instead of mimeTypes for File constraint #20893

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

Merged
merged 1 commit into from
May 18, 2025

Conversation

benito103e
Copy link
Contributor

You should always use the extensions option instead of mimeTypes except if you explicitly don't want to check that the extension of the file is consistent with its content (this can be a security issue).

By default, the extensions option also checks the media type of the file.

@carsonbot carsonbot changed the title Highligh 'extensions' instead of 'mimeTypes' for File constraint [Validator] Highligh 'extensions' instead of 'mimeTypes' for File constraint Apr 16, 2025
@javiereguiluz javiereguiluz added this to the 6.4 milestone Apr 16, 2025
Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is OK, but let's wait for more reviews.

Thanks!

@OskarStark OskarStark changed the title [Validator] Highligh 'extensions' instead of 'mimeTypes' for File constraint [Validator] Highlight extensions instead of mimeTypes for File constraint May 16, 2025
Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should always use the extensions option instead of mimeTypes except if you explicitly don't want to check that the extension of the file is consistent with its content (this can be a security issue).

By default, the extensions option also checks the media type of the file.
@xabbuh xabbuh changed the base branch from 7.2 to 6.4 May 18, 2025 11:00
@xabbuh
Copy link
Member

xabbuh commented May 18, 2025

Thank you @benito103e.

@xabbuh xabbuh merged commit aafade6 into symfony:6.4 May 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants