Use the hostname, not the ip address, in dev/test mode tests

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.1.1@43540 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-17 23:04:05 +00:00 committed by Sam Minnee
parent 126d6ebbf4
commit 3bd0d6d563

View File

@ -386,16 +386,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;
}
@ -408,7 +410,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;
}