FIX Prevent undefined index notice when trying to determine HTTP… (#440)

FIX Prevent undefined index notice when trying to determine HTTP_HOST during dev/build
This commit is contained in:
Guy Marriott 2019-07-30 10:36:48 +12:00 committed by GitHub
commit 917640699d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 // If there are no objects, default to the current hostname
return $_SERVER['HTTP_HOST']; return Director::host();
} }
/** /**

View File

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