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

Mime type fix for php versions under 5.3 (Trac #4734) #4734

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 7 comments
Closed

Mime type fix for php versions under 5.3 (Trac #4734) #4734

elgg-gitbot opened this issue Feb 16, 2013 · 7 comments

Comments

@elgg-gitbot
Copy link

@elgg-gitbot elgg-gitbot commented Feb 16, 2013

Original ticket http://trac.elgg.org/ticket/4734 on 42551348-02-02 by trac user rjcalifornia, assigned to unknown.

Elgg version: 1.8

Mime type is not detected if php version is under 5.3

This affects MP3, doc, docx, pptx, and other special documents.

Ticket comes from this:

http://community.elgg.org/discussion/view/1032677/a-simple-mp3-mime-type-fix-for-php-versions-under-53

However I realized that it happens to other type of documents as well. I tested under 1.8.x version with under php 5.3 and it is the same

@elgg-gitbot
Copy link
Author

@elgg-gitbot elgg-gitbot commented Feb 17, 2013

trac user mrclay wrote on 42551427-12-12

Hmm, comments on both finfo_file and mime_content_type seem to indicate problems with both. Can we decide on a small number of problematic extensions? Should we only try the manual lookup if certain values are returned?

@elgg-gitbot
Copy link
Author

@elgg-gitbot elgg-gitbot commented Feb 17, 2013

Milestone changed to Elgg 1.8.9 by trac user mrclay on 42551427-12-12

@elgg-gitbot
Copy link
Author

@elgg-gitbot elgg-gitbot commented Feb 17, 2013

cash wrote on 42551454-04-12

This is a very hard problem. It is affected by browser and server configuration. If you fallback on file extensions, you risk someone uploading something nasty and having it be misrepresented by your site.

MP3 files are especially difficult because MP3 is a stream rather than file format. There is no header so no magic code to go off of.

I'd like to see the appropriate hooks in Elgg 1.9 so that sites can customize their mime type detection plus do virus checking.

@elgg-gitbot
Copy link
Author

@elgg-gitbot elgg-gitbot commented Feb 17, 2013

ewinslow wrote on 42551751-05-24

I'd like to avoid doing anything just to accommodate PHP 5.2 since we're going to drop support soon. Cash's reason are much more compelling to me.

@elgg-gitbot
Copy link
Author

@elgg-gitbot elgg-gitbot commented Feb 17, 2013

Milestone changed to Elgg 1.8.12 by brettp on 42934480-07-19

@elgg-gitbot
Copy link
Author

@elgg-gitbot elgg-gitbot commented Feb 17, 2013

cash wrote on 42939730-05-24

Assigning to 1.9 where we can add the appropriate hooks.

@elgg-gitbot
Copy link
Author

@elgg-gitbot elgg-gitbot commented Feb 17, 2013

Milestone changed to Elgg 1.9.0 by cash on 42939730-05-24

@cash cash closed this in 9193801 May 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant