Skip to content

Commit

Permalink
do not send stored file if nothing to send given
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Oct 18, 2010
1 parent 1c79d7d commit 2f65797
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/filelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,14 @@ function send_file($path, $filename, $lifetime = 'default' , $filter=0, $pathiss
function send_stored_file($stored_file, $lifetime=86400 , $filter=0, $forcedownload=false, $filename=null, $dontdie=false) {
global $CFG, $COURSE, $SESSION;

if (!$stored_file or $stored_file->is_directory()) {
// nothing to serve
if ($dontdie) {
return;
}
die;
}

if ($dontdie) {
ignore_user_abort(true);
}
Expand Down

0 comments on commit 2f65797

Please sign in to comment.