mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-73013 filelib: Address coding style violations
This commit is contained in:
parent
90fb816444
commit
0b305d9330
@ -4562,7 +4562,6 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
|
|||||||
send_stored_file($file, 0, 0, true, $sendfileoptions);
|
send_stored_file($file, 0, 0, true, $sendfileoptions);
|
||||||
|
|
||||||
} else if ($filearea === 'event_description' and $context->contextlevel == CONTEXT_COURSECAT) {
|
} else if ($filearea === 'event_description' and $context->contextlevel == CONTEXT_COURSECAT) {
|
||||||
|
|
||||||
if ($CFG->forcelogin) {
|
if ($CFG->forcelogin) {
|
||||||
require_login();
|
require_login();
|
||||||
}
|
}
|
||||||
@ -4585,16 +4584,14 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
|
|||||||
// Retrieve file from storage, and serve.
|
// Retrieve file from storage, and serve.
|
||||||
$filename = array_pop($args);
|
$filename = array_pop($args);
|
||||||
$filepath = $args ? '/' . implode('/', $args) .'/' : '/';
|
$filepath = $args ? '/' . implode('/', $args) .'/' : '/';
|
||||||
if (!$file = $fs->get_file($context->id, $component, $filearea, $eventid, $filepath, $filename) or
|
$file = $fs->get_file($context->id, $component, $filearea, $eventid, $filepath, $filename)''
|
||||||
$file->is_directory()) {
|
if (!$file || $file->is_directory()) {
|
||||||
|
|
||||||
send_file_not_found();
|
send_file_not_found();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unlock session during file serving.
|
// Unlock session during file serving.
|
||||||
\core\session\manager::write_close();
|
\core\session\manager::write_close();
|
||||||
send_stored_file($file, HOURSECS, 0, $forcedownload, $sendfileoptions);
|
send_stored_file($file, HOURSECS, 0, $forcedownload, $sendfileoptions);
|
||||||
|
|
||||||
} else if ($filearea === 'event_description' and $context->contextlevel == CONTEXT_COURSE) {
|
} else if ($filearea === 'event_description' and $context->contextlevel == CONTEXT_COURSE) {
|
||||||
|
|
||||||
// Respect forcelogin and require login unless this is the site.... it probably
|
// Respect forcelogin and require login unless this is the site.... it probably
|
||||||
|
Loading…
x
Reference in New Issue
Block a user