-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[6.x] Fix mime validation for jpeg files #35518
Conversation
$this->assertFalse($v->passes()); | ||
|
||
$file2 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock(); | ||
$file2->expects($this->any())->method('guessExtension')->willReturn('jpeg'); | ||
$file2->expects($this->any())->method('guessExtension')->willReturn('jpg'); |
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've changed this because the recent Symfony change will always return jpg
here for jpeg
files.
I think that the same ‘problem’ happens with heic and heif files... Uploading a .heic file with this validation rule failes
But this works
|
I don't know anything about those file types sorry. |
yeah its ios default setting for saving photos nowadays... well my workaround works so I'll be fine :-) |
@it-can I had to do this to get it working And of course install the imagick on the server plus using something like |
These changes fixes a regression introduced by recent changes in Symfony and is a follow up to #35419. It makes sure that if either
mimes:jpeg
ormimes:jpg
is used that it doesn't matter wether the file is a.jpg
or.jpeg
file. This was the previous behaviour.I've also cleaned up some incorrect casing for the
image
rule and cleaned up the tests for themimetypes
rule which were a bit out of date it seems.As a side note it would be much better if these tests were integration tests against actual files but that's out of the scope for this PR.
See #35419 (comment)