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

[ticket/13031] Only use mimetype guesser guess if it helps us #2918

Merged
merged 3 commits into from Sep 6, 2014

Conversation

marc1706
Copy link
Member

@marc1706 marc1706 commented Sep 4, 2014

If we already have a mimetype and the guesser's guess is the default fallback,
we should keep the already existing mimetype the browser supplied. Otherwise,
platforms that might not support mimetype guessers will cause us to always
have the mimetype set to application/octet-stream on images. This will prevent
users from uploading images.

Ticket: https://tracker.phpbb.com/browse/PHPBB3-13031

If we already have a mimetype and the guesser's guess is the default fallback,
we should keep the already existing mimetype the browser supplied. Otherwise,
platforms that might not support mimetype guessers will cause us to always
have the mimetype set to application/octet-stream on images. This will prevent
users from uploading images.

PHPBB3-13031
…nit tests

The mime type 'application/octet-stream' will still always be overwritten by
proper guesses. However, guesses with guessers that have a higher priority
will now overwrite previous guesses even if the mime types of these guesses
had a slash in them.

PHPBB3-13031
@Nicofuma Nicofuma merged commit 21029e9 into phpbb:develop-ascraeus Sep 6, 2014
Nicofuma added a commit that referenced this pull request Sep 6, 2014
[ticket/13031] Only use mimetype guesser guess if it helps us

* marc1706/ticket/13031:
  [ticket/13031] Slightly change behavior of choose_mime_type and add unit tests
  [ticket/13031] Guess with all mimetype guessers and pick best guess
  [ticket/13031] Only use mimetype guesser guess if it helps us
@marc1706 marc1706 deleted the ticket/13031 branch September 6, 2014 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants