From: Brion Vibber Date: Thu, 22 Jan 2009 00:15:16 +0000 (+0000) Subject: Fix ordering of OpenDocument type detection so template files can actually be uploaded. X-Git-Tag: 1.31.0-rc.0~43313 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=5bb6e71e38d764ae467363fc70bb4502f9506c29;p=lhc%2Fweb%2Fwiklou.git Fix ordering of OpenDocument type detection so template files can actually be uploaded. Previously, the shorter types like 'text' matched before the longer ones like 'text-template', causing an .ott file to be misdetected as an .odt... and thus rejected for being the wrong type. --- diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index 4797752d03..d52de9941c 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -579,22 +579,22 @@ class MimeMagic { */ function detectZipType( $header ) { $opendocTypes = array( - 'chart', 'chart-template', - 'formula', + 'chart', 'formula-template', - 'graphics', + 'formula', 'graphics-template', - 'image', + 'graphics', 'image-template', - 'presentation', + 'image', 'presentation-template', - 'spreadsheet', + 'presentation', 'spreadsheet-template', - 'text', + 'spreadsheet', 'text-template', 'text-master', - 'text-web' ); + 'text-web', + 'text' ); // http://lists.oasis-open.org/archives/office/200505/msg00006.html $types = '(?:' . implode( '|', $opendocTypes ) . ')';