Skip to content
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

Image type detection #2

Open
rande opened this issue Aug 2, 2019 · 1 comment
Open

Image type detection #2

rande opened this issue Aug 2, 2019 · 1 comment

Comments

@rande
Copy link

rande commented Aug 2, 2019

Should you add a check on the content type before generating an event ?

@mazsudo
Copy link
Contributor

mazsudo commented Aug 3, 2019

At this point (in a private method of a final class), we have already check that content is a MediaInterface (inside getProvider method

if (!$media instanceof MediaInterface) {
and by type hinting in publishOptimizeMessage signature). Furthermore, only media handled by providers defined in configuration and from png/jpg type (
if (!\in_array($media->getExtension(), static::ALLOWED_EXTENSIONS)) {
) will launch an event.

Do you think to an additional check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants