From 647c25ca142aac2089552bcaabd6563e9573e5f7 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 20 Nov 2008 04:38:42 +0000 Subject: [PATCH] MINOR Added isset($_SERVER['HTTP_HOST']) checks to Director->isDev() and Director->isTest() - these environment variables are not available in CLI mode, and show up as PHP notices in a default cli-script/sake execution git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66302 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/Director.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/control/Director.php b/core/control/Director.php index 30b203169..7a5948241 100644 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -703,7 +703,7 @@ class Director { if(self::$environment_type) return self::$environment_type == 'dev'; // Check if we are running on one of the development servers - if(in_array($_SERVER['HTTP_HOST'], Director::$dev_servers)) { + if(isset($_SERVER['HTTP_HOST']) && in_array($_SERVER['HTTP_HOST'], Director::$dev_servers)) { return true; } /* @@ -728,7 +728,7 @@ class Director { } // Check if we are running on one of the test servers - if(in_array($_SERVER['HTTP_HOST'], Director::$test_servers)) { + if(isset($_SERVER['HTTP_HOST']) && in_array($_SERVER['HTTP_HOST'], Director::$test_servers)) { return true; }