mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-31901 draftfile.php supports the preview parameter
This commit is contained in:
parent
97b603c621
commit
9d19777234
1 changed files with 2 additions and 1 deletions
|
@ -36,6 +36,7 @@ if (isguestuser()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$relativepath = get_file_argument();
|
$relativepath = get_file_argument();
|
||||||
|
$preview = optional_param('preview', null, PARAM_ALPHANUM);
|
||||||
|
|
||||||
// relative path must start with '/'
|
// relative path must start with '/'
|
||||||
if (!$relativepath) {
|
if (!$relativepath) {
|
||||||
|
@ -84,4 +85,4 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->get_filename() ==
|
||||||
// finally send the file
|
// finally send the file
|
||||||
// ========================================
|
// ========================================
|
||||||
session_get_instance()->write_close(); // unlock session during fileserving
|
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…
Add table
Add a link
Reference in a new issue