From 46b77fa1b16434cff5aaa1e48052dabfd6307481 Mon Sep 17 00:00:00 2001 From: Joshua Sherman Date: Tue, 14 Jan 2014 11:34:51 -0500 Subject: [PATCH] Added sanity check to resolve missing variable Unsure why but as of this morning (perhaps because of upgrading to PHP 5.5.8 PHPUnit started barking about _SERVER['HTTP_HOST'] not being set. --- classes/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index 91b23b7..7a2d222 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -100,7 +100,7 @@ class Config extends Object // Exact match if ((preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $host) && $_SERVER['SERVER_ADDR'] == $host) - || $_SERVER['HTTP_HOST'] == $host) + || (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == $host)) { $environment = $name; break;