Skip to content

Commit

Permalink
MDL-73013 filelib: Address coding style violations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols authored and sarjona committed Jun 10, 2022
1 parent 3ec081f commit f5e1074
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/filelib.php
Expand Up @@ -4562,7 +4562,6 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
send_stored_file($file, 0, 0, true, $sendfileoptions);

} else if ($filearea === 'event_description' and $context->contextlevel == CONTEXT_COURSECAT) {

if ($CFG->forcelogin) {
require_login();
}
Expand All @@ -4585,16 +4584,14 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
// Retrieve file from storage, and serve.
$filename = array_pop($args);
$filepath = $args ? '/' . implode('/', $args) .'/' : '/';
if (!$file = $fs->get_file($context->id, $component, $filearea, $eventid, $filepath, $filename) or
$file->is_directory()) {

$file = $fs->get_file($context->id, $component, $filearea, $eventid, $filepath, $filename)''
if (!$file || $file->is_directory()) {
send_file_not_found();
}
// Unlock session during file serving.
\core\session\manager::write_close();
send_stored_file($file, HOURSECS, 0, $forcedownload, $sendfileoptions);

} else if ($filearea === 'event_description' and $context->contextlevel == CONTEXT_COURSE) {

// Respect forcelogin and require login unless this is the site.... it probably
Expand Down

0 comments on commit f5e1074

Please sign in to comment.