From f33a6d3840193e9fde055bfd548d24efa8250b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Fri, 8 Oct 2010 15:55:46 +0200 Subject: [PATCH] Feature #2044 add mimetypes for svgz (compress svg file) --- main/document/document.inc.php | 2 +- main/inc/lib/document.lib.php | 1 + main/inc/lib/fileDisplay.lib.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main/document/document.inc.php b/main/document/document.inc.php index ac250b8175..2f13ccacbe 100755 --- a/main/document/document.inc.php +++ b/main/document/document.inc.php @@ -124,7 +124,7 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility $ext = strtolower($ext[sizeof($ext) - 1]); // "htmlfiles" are shown in a frameset - if ($ext == 'htm' || $ext == 'html' || $ext == 'gif' || $ext == 'jpg' || $ext == 'jpeg' || $ext == 'png' || $ext == 'pdf' || $ext == 'swf' || $ext == 'mp3' || ($ext == 'svg' && support_svg())) { + if ($ext == 'htm' || $ext == 'html' || $ext == 'gif' || $ext == 'jpg' || $ext == 'jpeg' || $ext == 'png' || $ext == 'pdf' || $ext == 'swf' || $ext == 'mp3' || ($ext == 'svg' || $ext =='svgz' && support_svg())) { $url = 'showinframes.php?'.api_get_cidreq().'&file='.$url_path.$req_gid; } else { // url-encode for problematic characters (we may not call them dangerous characters...) diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index fe349ef06c..6d496ee42f 100755 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -196,6 +196,7 @@ class DocumentManager { 'sv4crc' => 'application/x-sv4crc', 'svf' => 'application/vnd.svf', 'svg' => 'image/svg+xml', + 'svgz'=> 'image/svg+xml', 'swf' => 'application/x-shockwave-flash', 'sxc' => 'application/vnd.sun.xml.calc', 'sxi' => 'application/vnd.sun.xml.impress', diff --git a/main/inc/lib/fileDisplay.lib.php b/main/inc/lib/fileDisplay.lib.php index bd07f4075d..b3dca288a6 100755 --- a/main/inc/lib/fileDisplay.lib.php +++ b/main/inc/lib/fileDisplay.lib.php @@ -53,7 +53,7 @@ function choose_image($file_name) $type['word' ] = array('doc', 'dot', 'rtf', 'mcw', 'wps', 'psw', 'docm', 'docx', 'dotm', 'dotx'); $type['web' ] = array('htm', 'html', 'htx', 'xml', 'xsl', 'php', 'xhtml'); $type['image' ] = array('gif', 'jpg', 'png', 'bmp', 'jpeg'); - $type['image_vect'] = array('svg'); + $type['image_vect'] = array('svg','svgz'); $type['audio' ] = array('wav', 'mid', 'mp2', 'mp3', 'midi', 'sib', 'amr', 'kar'); $type['video' ] = array('mp4', 'mov', 'rm', 'pls', 'mpg', 'mpeg', 'au', 'flv', 'avi', 'wmv', 'asf', '3gp'); $type['excel' ] = array('xls', 'xlt', 'xls', 'xlt', 'pxl', 'xlsx', 'xlsm', 'xlam', 'xlsb', 'xltm', 'xltx');