Make an initial stab at refactoring the mime type detection.
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 5 Feb 2008 22:11:36 +0000 (22:11 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 5 Feb 2008 22:11:36 +0000 (22:11 +0000)
commitd2722f9351d64198f9ad76ec17ffb5efa40801f3
tree63631d3317844e00d257ed775641dfbe3580229d
parent608584eb33b9ad93d638adfdb41006755f718fe5
Make an initial stab at refactoring the mime type detection.

Adds magic header checks for the following types:
* MIDI
* Ogg
* PDF
* XCF
* DOS/Windows, Mach-O, and ELF executables

Locks down detection to prevent uploading different file types for the following extensions:
* mid, ogg, pdf, svg, wmf, xcf

This should now cover all the file types we have uploadable at Wikimedia public sites. (I've disabled the old StarOffice formats.)

Changed priority so our own checks happen in favor of the external checks, since we don't trust that stuff. Would like to see much further work here to replace it all.

Hopefully I haven't broken SVG files; I'm not 100% certain the built-in checks are correct.
includes/MimeMagic.php