Browse Source

Feature #2044 add mimetypes for svgz (compress svg file)

Juan Carlos Raña 14 years ago
parent
commit
f33a6d3840

+ 1 - 1
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...)

+ 1 - 0
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',

+ 1 - 1
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');