From db24312891603aed2536129a7755ca8082ff038b Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 29 Jan 2005 15:16:32 +0000 Subject: [PATCH] cleaned download filename SC#69, merged from MOODLE_12_STABLE --- mod/quiz/report/simplestat/report.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/quiz/report/simplestat/report.php b/mod/quiz/report/simplestat/report.php index 049ad14cf0..f1ae7a764e 100644 --- a/mod/quiz/report/simplestat/report.php +++ b/mod/quiz/report/simplestat/report.php @@ -537,7 +537,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"); @@ -596,7 +597,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"); -- 2.39.5