mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-71338 tool_usertours: correct Content-Type on tour export.
Replace existing code with standard file serving mechanism, in turn correcting the previously incorrect Content-Type header.
This commit is contained in:
parent
30e6bf75dd
commit
a6a5130a65
1 changed files with 1 additions and 11 deletions
|
@ -438,17 +438,7 @@ class manager {
|
||||||
$filename = 'tour_export_' . $tour->get_id() . '_' . time() . '.json';
|
$filename = 'tour_export_' . $tour->get_id() . '_' . time() . '.json';
|
||||||
|
|
||||||
// Force download.
|
// Force download.
|
||||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
|
send_file($exportstring, $filename, 0, 0, true, true);
|
||||||
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0');
|
|
||||||
header('Expires: ' . gmdate('D, d M Y H:i:s', 0) . 'GMT');
|
|
||||||
header('Pragma: no-cache');
|
|
||||||
header('Accept-Ranges: none');
|
|
||||||
header('Content-disposition: attachment; filename=' . $filename);
|
|
||||||
header('Content-length: ' . strlen($exportstring));
|
|
||||||
header('Content-type: text/calendar; charset=utf-8');
|
|
||||||
|
|
||||||
echo $exportstring;
|
|
||||||
die;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue