* @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;