-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Allow multiple mime types per extension in file validation #20207
Comments
I am willing to contribute this feature if you are open to support it. |
If it is a valid case, if the implementation is not BC, there would be no problem. |
skepticspriggan
changed the title
Multiple mime types per extension
Allow multiple mime types per extension in file validation
Jun 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What steps will reproduce the problem?
The majority of files have only one mime type per extension, however, some files do have different mime types per extension.
For example, I have come across
.msg
files with mime typeapplication/vnd.ms-office
orapplication/vnd.ms-outlook
. Another case is.eml
files with mime typemessage/rfc822
ortext/plain
. Unfortunately, I cannot enclose these emails since it would breach confidentiality.When these files are validated, one of the files will be unintentionally marked as invalid.
The check can be disabled by setting the
checkExtensionByMimeType
property offramework/validators/FileValidator
to false, however, this is less safe.What is the expected result?
FileValidator supports multiple mime types per extension when
checkExtensionByMimeType
is enabled.What do you get instead?
FileValidator does not support multiple mime types per extension.
Additional information
The values of the array in framework/helpers/mimeTypes.php will be allowed to be an array of strings by adjusting framework/validators/FileValidator.php#L386-L397.
The text was updated successfully, but these errors were encountered: