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

The problem is in getting the file sharing by Mime #2732

Closed
demortx opened this issue Mar 20, 2020 · 1 comment
Closed

The problem is in getting the file sharing by Mime #2732

demortx opened this issue Mar 20, 2020 · 1 comment

Comments

@demortx
Copy link

demortx commented Mar 20, 2020

return Mimes::guessExtensionFromType($this->getClientMimeType(), $this->getClientExtension()) ?? $this->getClientExtension();

I’m definitely not sure, but I ran into a problem, when downloading a file it doesn’t determine the exact extension by Mime, in my code, an error was made in the Mime source in the code.

If so, let me know I will fix it.

Now you can upload any file simply by changing the extension from .php to .png and the validator will not notice

Fix?
return Mimes::guessExtensionFromType($this->getMimeType(), $.....

@MGatner
Copy link
Member

MGatner commented Mar 23, 2020

Since actual MIME type detection is imperfect I think the choice was to go with the extension since it is a simpler and more predictable solution. I'll see if @lonnieezell has anything else to say.

@MGatner MGatner closed this as completed Aug 25, 2020
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