MDL-31901 draftfile.php supports the preview parameter

This commit is contained in:
David Mudrak 2012-05-12 16:20:40 +02:00 committed by Marina Glancy
parent 97b603c621
commit 9d19777234

View File

@ -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!