From: moodler Date: Sat, 17 Apr 2004 03:27:27 +0000 (+0000) Subject: Clean filenames to prevent possible problems with IE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=deba41af8c90be1084f421d7bafb2b52fb3f4983;p=moodle.git Clean filenames to prevent possible problems with IE --- diff --git a/mod/survey/download.php b/mod/survey/download.php index b4a7dd1bcd..a434f290d1 100644 --- a/mod/survey/download.php +++ b/mod/survey/download.php @@ -125,7 +125,8 @@ 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"); @@ -195,7 +196,9 @@ // 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