Skip to content

Commit

Permalink
MDL-31901 draftfile.php supports the preview parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz authored and marinaglancy committed May 21, 2012
1 parent 97b603c commit 9d19777
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion draftfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
}

$relativepath = get_file_argument();
$preview = optional_param('preview', null, PARAM_ALPHANUM);

// relative path must start with '/'
if (!$relativepath) {
Expand Down Expand Up @@ -84,4 +85,4 @@
// 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!

0 comments on commit 9d19777

Please sign in to comment.