mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Use Director::host() over direct $_SERVER access
This commit is contained in:
parent
9a7cdbbe2d
commit
09abe2b2f2
@ -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 isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
|
return Director::host();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,7 +185,7 @@ class SubsiteDomain extends DataObject
|
|||||||
*/
|
*/
|
||||||
public function getSubstitutedDomain()
|
public function getSubstitutedDomain()
|
||||||
{
|
{
|
||||||
$currentHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
|
$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:
|
||||||
|
Loading…
Reference in New Issue
Block a user