From 5bb6e71e38d764ae467363fc70bb4502f9506c29 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 22 Jan 2009 00:15:16 +0000 Subject: [PATCH] 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. --- includes/MimeMagic.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 ) . ')'; -- 2.20.1