cleaned download filename SC#69

This commit is contained in:
skodak
2005-01-29 15:14:50 +00:00
parent 157d9457f2
commit 642f1e22ed
+4 -2
View File
@@ -541,7 +541,8 @@ class quiz_report extends quiz_default_report {
require_once("$CFG->libdir/excel/Worksheet.php");
require_once("$CFG->libdir/excel/Workbook.php");
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$course->shortname ".$quiz->name.".xls" );
$downloadfilename = clean_filename("$course->shortname $quiz->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");
@@ -600,7 +601,8 @@ class quiz_report extends quiz_default_report {
/// Print header to force download
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=$course->shortname ".$quiz->name.".txt");
$downloadfilename = clean_filename("$course->shortname $quiz->name");
header("Content-Disposition: attachment; filename=$downloadfilename.txt");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");