From 388af120fe46c842d32c07c0d9073c7be0f3ebd2 Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Thu, 16 May 2024 09:08:22 +0000
Subject: [PATCH] fixes #4143

Closes #4143

Merge request studip/studip!2986
---
 lib/bootstrap.php | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/bootstrap.php b/lib/bootstrap.php
index 9afc16a7a68..177fc08ea2c 100644
--- a/lib/bootstrap.php
+++ b/lib/bootstrap.php
@@ -69,10 +69,6 @@ if (isset($_SERVER['SERVER_NAME'])) {
     $ABSOLUTE_URI_STUDIP .= $CANONICAL_RELATIVE_PATH_STUDIP;
 }
 
-// default ASSETS_URL and ASSETS_PATH, customize if required
-$GLOBALS['ASSETS_URL'] = $ABSOLUTE_URI_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';
@@ -93,6 +89,14 @@ foreach($added_configs as $key => $value) {
     $GLOBALS[$key] = $value;
 }
 
+// create ASSETS_URL and ASSETS_PATH if not customized in config_local.inc.php
+if (!isset($GLOBALS['ASSETS_URL'])) {
+    $GLOBALS['ASSETS_URL'] = $ABSOLUTE_URI_STUDIP . 'assets/';
+}
+if (!isset($GLOBALS['ASSETS_PATH'])) {
+    $GLOBALS['ASSETS_PATH'] = $ABSOLUTE_PATH_STUDIP . 'assets/';
+}
+
 // If no ENV setting was found in the config files, assume ENV=production
 if (!defined('Studip\ENV')) {
     define('Studip\ENV', DEFAULT_ENV);
-- 
GitLab