From 0d830fa818c20a7bda5e58e4ab93ff16887800d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 18 Aug 2008 22:56:07 +0000 Subject: [PATCH] Missing SERVER_NAME in non-web applications fixed --- inc/config/class_FrameworkConfiguration.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 1178361..6bfdfbf 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -292,8 +292,14 @@ class FrameworkConfiguration implements Registerable { * @return $fullDomain The detected full domain */ public function detectDomain () { - // Detect the full domain - $fullDomain = htmlentities(strip_tags($_SERVER['SERVER_NAME']), ENT_QUOTES); + // Full domain is localnet.invalid by default + $fullDomain = "localnet.invalid"; + + // Is the server name there? + if (isset($_SERVER['SERVER_NAME'])) { + // Detect the full domain + $fullDomain = htmlentities(strip_tags($_SERVER['SERVER_NAME']), ENT_QUOTES); + } // END - if // Return it return $fullDomain; -- 2.39.2