brion(a)svn.wikimedia.org wrote:
Revision: 41264
Author: brion
Date: 2008-09-25 18:43:33 +0000 (Thu, 25 Sep 2008)
Log Message:
-----------
* Improved upload file type detection for OpenDocument formats
Added a check for the magic value header in OpenDocument zip archives which specifies
which subtype it is. Such files will get detected with the appropriate mime type and
matching extension, so ODT etc uploads will work again where enabled.
(Previously the general ZIP check and blacklist would disable them.)
I think you're missing the point. It's trivial to make a file which is
both a valid OpenDocument file, and a valid JAR file subject to the same
origin policy.
http://noc.wikimedia.org/~tstarling/odjar/
print $mm->guessMimeType('.../odjar.odt')
application/vnd.oasis.opendocument.text
Just done with zip/unzip, no hex editing involved.
-- Tim Starling