mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #14965
[Bug 1249858] [NEW] Mahara can't figure out mime types because of a finfo() bug
Public bug reported:
There have been several notable Mahara bugs based around the fact that
our current handling of mimetypes is broken.
See for instance:
- https://bugs.launchpad.net/mahara/+bug/1220639
- https://bugs.launchpad.net/mahara/+bug/1249166
The problem is this:
1. You can't really trust the mimetype that the browser sends to you, because different browsers send different wacky things
2. Mahara has long used its own function file_mime_type() in lib/file.php for this purpose
3. file_mime_type() preferentially uses finfo() to check the mimetype. But, there's a bug in finfo() with an external magic db, which is how it is distributed on Ubuntu presently: https://bugs.php.net/bug.php?id=61940
4. file_mime_type() falls back to mime_content_type(). But that's now deprecated
5. If neither of those works, we fall back to trusting what the browser told us, which isn't really the best (see #1)
** Affects: mahara
Importance: Medium
Assignee: Robert Lyon (robertl-9)
Status: Confirmed
** Tags: fileupload mimetype
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1249858
Title:
Mahara can't figure out mime types because of a finfo() bug
Status in Mahara ePortfolio:
Confirmed
Bug description:
There have been several notable Mahara bugs based around the fact that
our current handling of mimetypes is broken.
See for instance:
- https://bugs.launchpad.net/mahara/+bug/1220639
- https://bugs.launchpad.net/mahara/+bug/1249166
The problem is this:
1. You can't really trust the mimetype that the browser sends to you, because different browsers send different wacky things
2. Mahara has long used its own function file_mime_type() in lib/file.php for this purpose
3. file_mime_type() preferentially uses finfo() to check the mimetype. But, there's a bug in finfo() with an external magic db, which is how it is distributed on Ubuntu presently: https://bugs.php.net/bug.php?id=61940
4. file_mime_type() falls back to mime_content_type(). But that's now deprecated
5. If neither of those works, we fall back to trusting what the browser told us, which isn't really the best (see #1)
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1249858/+subscriptions
Follow ups
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Robert Lyon, 2014-04-22
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2014-04-03
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Robert Lyon, 2014-04-03
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-03
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Robert Lyon, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A change has been merged
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2014-04-02
-
[Bug 1249858] A patch has been submitted for review
From: Mahara Bot, 2014-04-02
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Robert Lyon, 2014-03-27
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2014-02-25
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Kristina Hoeppner, 2014-01-26
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2013-12-16
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2013-12-16
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Kristina Hoeppner, 2013-11-13
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2013-11-11
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2013-11-11
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Robert Lyon, 2013-11-11
-
[Bug 1249858] Re: Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2013-11-10
-
[Bug 1249858] [NEW] Mahara can't figure out mime types because of a finfo() bug
From: Aaron Wells, 2013-11-10
References