From a9af3c9cd44ac899ce5b2910f7952e4e7c53ced6 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 9 Jun 2022 11:49:58 +0800 Subject: [PATCH] MDL-73013 filelib: Address coding style violations --- lib/filelib.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/filelib.php b/lib/filelib.php index 0bcdcb23dbc..56988d7fd6a 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -4556,7 +4556,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(); } @@ -4579,16 +4578,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