From ecebf3a8627f527cbd184b7907dd91f65764617b Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 2 Dec 2008 22:03:22 +0100 Subject: Make content-disposition configurable in mime.conf FS#1541 With this patch it is possible to define if a file should be served as download or be displayed inside the browser (if supported) by configuring it in conf/mime.conf Mimetypes that should be served with a "Content-Disposition: attachment" header need to be prefixed with a exclamation mark. All others will be served inline. This will also fix a Problem with Flash 10. darcs-hash:20081202210322-7ad00-6e7ef30aff9322cd135311be77809187da121f3b.gz --- inc/parser/xhtml.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index fda1ef36e..58ff5e7b1 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -675,7 +675,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $render = ($linking == 'linkonly') ? false : true; $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render); - list($ext,$mime) = mimetype($src); + list($ext,$mime,$dl) = mimetype($src); if(substr($mime,0,5) == 'image' && $render){ $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),($linking=='direct')); }elseif($mime == 'application/x-shockwave-flash' && $render){ @@ -705,7 +705,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['url'] = ml($src,array('cache'=>$cache)); - list($ext,$mime) = mimetype($src); + list($ext,$mime,$dl) = mimetype($src); if(substr($mime,0,5) == 'image' && $render){ // link only jpeg images // if ($ext != 'jpg' && $ext != 'jpeg') $noLink = true; @@ -909,7 +909,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $ret = ''; - list($ext,$mime) = mimetype($src); + list($ext,$mime,$dl) = mimetype($src); if(substr($mime,0,5) == 'image'){ // first get the $title if (!is_null($title)) { -- cgit v1.2.3