]> git.mjollnir.org Git - moodle.git/commitdiff
Clean filenames to prevent possible problems with IE
authormoodler <moodler>
Sat, 17 Apr 2004 03:27:27 +0000 (03:27 +0000)
committermoodler <moodler>
Sat, 17 Apr 2004 03:27:27 +0000 (03:27 +0000)
mod/survey/download.php

index b4a7dd1bcd8f60d0f3a14831aaf3f2558ef490ef..a434f290d1ff9925e533e954ef0e503ef7ce1805 100644 (file)
         require_once("$CFG->libdir/excel/Workbook.php");
 
         header("Content-type: application/vnd.ms-excel");
-        header("Content-Disposition: attachment; filename=".$survey->name.".xls");
+        $downloadfilename = clean_filename("$course->shortname $survey->name");
+        header("Content-Disposition: attachment; filename=$downloadfilename.xls");
         header("Expires: 0");
         header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
         header("Pragma: public");
 // Print header to force download
 
     header("Content-Type: application/download\n"); 
-    header("Content-Disposition: attachment; filename=\"$survey->name.txt\"");
+
+    $downloadfilename = clean_filename("$course->shortname $survey->name");
+    header("Content-Disposition: attachment; filename=\"$downloadfilename.txt\"");
 
 // Print names of all the fields