diff --git a/bootstrap.php b/bootstrap.php index fd319dc..24cb524 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -32,11 +32,6 @@ // This call is required by Moodle, but this script should have been called by config.php anyway. require_once(__DIR__.'/../../config.php'); -// This file does nothing if running from CLI. -if (defined('CLI_SCRIPT') && CLI_SCRIPT) { - return; -} - // We need the CFG->dataroot, if not set yet this script is called too early in config.php file. if (!isset($CFG->dataroot)) { return; diff --git a/file.php b/file.php index 8884d37..3bdc90f 100644 --- a/file.php +++ b/file.php @@ -64,7 +64,8 @@ function auth_outage_bootstrap_callback() { // We are not using any external libraries or references in this file (cli maintenance is active). // If you change the path below maybe you need to change maintenance_static_page::get_resources_folder() as well. - $resourcedir = $CFG->dataroot.'/auth_outage/climaintenance'; + $resourcedir = rtrim($CFG->dataroot, '/'); // In case the configuration has a trailing slash. + $resourcedir = $resourcedir.'/auth_outage/climaintenance'; // Protect against path traversal attacks. $file = $resourcedir.'/'.$_GET['file'];