mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
do not send stored file if nothing to send given
This commit is contained in:
parent
1c79d7db3b
commit
2f65797837
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user