-
Notifications
You must be signed in to change notification settings - Fork 9.4k
move hardcoded MIME types from class private to DI configuration. #18365
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
move hardcoded MIME types from class private to DI configuration. #18365
Conversation
…euploader' into resolve-hardcoded-mimetypes-imageuploader
| /** | ||
| * @return string[] | ||
| */ | ||
| public function getAllowedMimeTypes() |
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.
Why need such getter?
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.
ok, we do not need it. i have followed the convention by $allowedExtensions
| 'image/gif', | ||
| 'image/png', | ||
| ]; | ||
| protected $allowedMimeTypes; |
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.
Must remain private.
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.
it can be private.
what is the purpose of users can extend allowedExtensions but allowedMimeTypes is hardcoded?
I think two property is connected logically.
|
@orlangur i've answered and fixed all of your requests. thank you! |
|
Hi @sidolov, thank you for the review. |
|
Hi @orlangur, thank you for the review. |
|
Hi @tufahu. Thank you for your contribution. |
Description
With this fix, developers can add custom catalog image types like SVG from di.xml configuration.
In Catalog ImageUploader allowed extensions can be customized, but allowed mime types are hardcoded in the class into a private property. (with no getter method). This PR solves this limitation.