From: moodler Date: Sat, 17 Apr 2004 03:30:26 +0000 (+0000) Subject: clean the filenames to make sure there aren't funny characters X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b124c95ab461327a4412250749f10a650b99afee;p=moodle.git clean the filenames to make sure there aren't funny characters --- diff --git a/course/grades.php b/course/grades.php index d8c3dd3ad5..8ac6b0356b 100644 --- a/course/grades.php +++ b/course/grades.php @@ -147,7 +147,8 @@ // HTTP headers header("Content-type: application/vnd.ms-excel"); - header("Content-Disposition: attachment; filename=".$course->shortname."_$strgrades.xls"); + $downloadfilename = clean_filename("$course->shortname $strgrades"); + header("Content-Disposition: attachment; filename=\"$downloadfilename.xls\""); header("Expires: 0"); header("Cache-Control: must-revalidate,post-check=0,pre-check=0"); header("Pragma: public"); @@ -203,7 +204,8 @@ /// Print header to force download header("Content-Type: application/download\n"); - header("Content-Disposition: attachment; filename=\"$course->shortname $strgrades.txt\""); + $downloadfilename = clean_filename("$course->shortname $strgrades"); + header("Content-Disposition: attachment; filename=\"$downloadfilename.txt\""); /// Print names of all the fields