mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-31901 draftfile.php supports the preview parameter
This commit is contained in:
parent
97b603c621
commit
9d19777234
@ -36,6 +36,7 @@ if (isguestuser()) {
|
||||
}
|
||||
|
||||
$relativepath = get_file_argument();
|
||||
$preview = optional_param('preview', null, PARAM_ALPHANUM);
|
||||
|
||||
// relative path must start with '/'
|
||||
if (!$relativepath) {
|
||||
@ -84,4 +85,4 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->get_filename() ==
|
||||
// finally send the file
|
||||
// ========================================
|
||||
session_get_instance()->write_close(); // unlock session during fileserving
|
||||
send_stored_file($file, 0, false, true); // force download - security first!
|
||||
send_stored_file($file, 0, false, true, array('preview' => $preview)); // force download - security first!
|
||||
|
Loading…
x
Reference in New Issue
Block a user