Use the hostname, not the ip address, in dev/test mode tests (merged from 2.1.1 branch, r43542)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44194 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-11-04 21:15:41 +00:00
parent 13a66fec1f
commit a462cd2c20

View File

@ -442,16 +442,18 @@ class Director {
return true;
}
}
if(isset($_SESSION['isDev']) && $_SESSION['isDev']) return true;
// Check if we are running on one of the development servers
if(in_array($_SERVER['SERVER_ADDR'], Director::$dev_servers)) {
if(in_array($_SERVER['HTTP_HOST'], Director::$dev_servers)) {
return true;
}
// Check if we are running on one of the test servers
if(in_array($_SERVER['SERVER_ADDR'], Director::$test_servers)) {
if(in_array($_SERVER['HTTP_HOST'], Director::$test_servers)) {
return true;
}
@ -464,7 +466,7 @@ class Director {
}
// Check if we are running on one of the test servers
if(in_array($_SERVER['SERVER_ADDR'], Director::$test_servers)) {
if(in_array($_SERVER['HTTP_HOST'], Director::$test_servers)) {
return true;
}