]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15032: add quotes to make it possible to correctly send files with names containi...
authorscyrma <scyrma>
Wed, 28 May 2008 07:44:35 +0000 (07:44 +0000)
committerscyrma <scyrma>
Wed, 28 May 2008 07:44:35 +0000 (07:44 +0000)
lib/filelib.php

index b21c11594fa31aa86b41352bbd9bf372d5584b83..7a69af00ce2f8d1308f24bace7bc6ecee33d08ff 100644 (file)
@@ -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) {