Skip to content
Snippets Groups Projects
Commit eb289a85 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #4034

Closes #4034

Merge request studip/studip!2889
parent b3399e96
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,16 @@ if (isset($_SERVER['SERVER_NAME'])) { ...@@ -65,6 +65,16 @@ if (isset($_SERVER['SERVER_NAME'])) {
$GLOBALS['ASSETS_URL'] = $ABSOLUTE_URI_STUDIP . 'assets/'; $GLOBALS['ASSETS_URL'] = $ABSOLUTE_URI_STUDIP . 'assets/';
$GLOBALS['ASSETS_PATH'] = $ABSOLUTE_PATH_STUDIP . 'assets/'; $GLOBALS['ASSETS_PATH'] = $ABSOLUTE_PATH_STUDIP . 'assets/';
// Check if instance is configured; redirect to install script if not
if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] . '/config/config_local.inc.php') && php_sapi_name() !== 'cli') {
require_once __DIR__ . '/classes/URLHelper.php';
URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']);
header('Location: ' . URLHelper::getURL('install.php'));
die;
}
// Load configuration
require __DIR__ . '/classes/StudipFileloader.php'; require __DIR__ . '/classes/StudipFileloader.php';
$added_configs = []; $added_configs = [];
...@@ -80,14 +90,6 @@ if (!defined('Studip\ENV')) { ...@@ -80,14 +90,6 @@ if (!defined('Studip\ENV')) {
define('Studip\ENV', DEFAULT_ENV); define('Studip\ENV', DEFAULT_ENV);
} }
if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] . '/config/config_local.inc.php') && php_sapi_name() !== 'cli') {
require_once __DIR__ . '/classes/URLHelper.php';
URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']);
header('Location: ' . URLHelper::getURL('install.php'));
die;
}
require __DIR__ . '/bootstrap-autoload.php'; require __DIR__ . '/bootstrap-autoload.php';
// construct absolute URL for ASSETS_URL // construct absolute URL for ASSETS_URL
......
...@@ -27,6 +27,12 @@ class StudipFileloader ...@@ -27,6 +27,12 @@ class StudipFileloader
$_oldVariableNames = array_keys(get_defined_vars()); $_oldVariableNames = array_keys(get_defined_vars());
foreach (preg_split('/ /', $_filename, -1, PREG_SPLIT_NO_EMPTY) as $file) { foreach (preg_split('/ /', $_filename, -1, PREG_SPLIT_NO_EMPTY) as $file) {
if (
!file_exists($file)
&& !stream_resolve_include_path($file)
) {
continue;
}
include $file; include $file;
} }
unset($file); unset($file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment