From: scyrma Date: Wed, 28 May 2008 07:44:35 +0000 (+0000) Subject: MDL-15032: add quotes to make it possible to correctly send files with names containi... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4638009bfc5b4dfa72d1d4f9a4b100ebfe4cdf6e;p=moodle.git MDL-15032: add quotes to make it possible to correctly send files with names containing spaces (merge from 1.9) --- diff --git a/lib/filelib.php b/lib/filelib.php index b21c11594f..7a69af00ce 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -598,13 +598,13 @@ function send_file($path, $filename, $lifetime=86400 , $filter=0, $pathisstring= // if user is using IE, urlencode the filename so that multibyte file name will show up correctly on popup if (check_browser_version('MSIE')) { - $filename = urlencode($filename); + $filename = rawurlencode($filename); } if ($forcedownload) { - @header('Content-Disposition: attachment; filename='.$filename); + @header('Content-Disposition: attachment; filename="'.$filename.'"'); } else { - @header('Content-Disposition: inline; filename='.$filename); + @header('Content-Disposition: inline; filename="'.$filename.'"'); } if ($lifetime > 0) {