Revision: 45989
Author:   brion
Date:     2009-01-22 00:15:16 +0000 (Thu, 22 Jan 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/phase3/includes/MimeMagic.php

Modified: trunk/phase3/includes/MimeMagic.php
===================================================================
--- trunk/phase3/includes/MimeMagic.php 2009-01-22 00:11:23 UTC (rev 45988)
+++ trunk/phase3/includes/MimeMagic.php 2009-01-22 00:15:16 UTC (rev 45989)
@@ -579,22 +579,22 @@
         */
        function detectZipType( $header ) {
                $opendocTypes = array(
+                       'chart-template',
                        'chart',
-                       'chart-template',
+                       'formula-template',
                        'formula',
-                       'formula-template',
+                       'graphics-template',
                        'graphics',
-                       'graphics-template',
+                       'image-template',
                        'image',
-                       'image-template',
+                       'presentation-template',
                        'presentation',
-                       'presentation-template',
+                       'spreadsheet-template',
                        'spreadsheet',
-                       'spreadsheet-template',
-                       'text',
                        'text-template',
                        'text-master',
-                       'text-web' );
+                       'text-web',
+                       'text' );
 
                // 
http://lists.oasis-open.org/archives/office/200505/msg00006.html
                $types = '(?:' . implode( '|', $opendocTypes ) . ')';



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to