From deba41af8c90be1084f421d7bafb2b52fb3f4983 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 17 Apr 2004 03:27:27 +0000 Subject: [PATCH] Clean filenames to prevent possible problems with IE --- mod/survey/download.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.39.5