FIX Prevent undefined index notice when trying to determine HTTP_HOST during dev/build

This commit is contained in:
Robbie Averill 2019-07-26 09:53:54 +02:00
parent 7d27abf2b1
commit 9a7cdbbe2d
2 changed files with 2 additions and 2 deletions

View File

@ -870,7 +870,7 @@ class Subsite extends DataObject
}
// If there are no objects, default to the current hostname
return $_SERVER['HTTP_HOST'];
return isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
}
/**

View File

@ -185,7 +185,7 @@ class SubsiteDomain extends DataObject
*/
public function getSubstitutedDomain()
{
$currentHost = $_SERVER['HTTP_HOST'];
$currentHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
// If there are wildcards in the primary domain (not recommended), make some
// educated guesses about what to replace them with: