Missing SERVER_NAME in non-web applications fixed
[shipsimu.git] / inc / config / class_FrameworkConfiguration.php
index 117836175e37a674285e571e74cbe88c861a1a6a..6bfdfbf7c1efab379a9cb45a1c0a2bd9e4d0b6ad 100644 (file)
@@ -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;