From 523c19e88a9972f402d0803dff0df123e8d8b7c1 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Fri, 13 Apr 2012 17:28:20 +1200 Subject: [PATCH] BUGFIX: fixing core error that occurs when there are two or more proxy servers in front of the SilverStripe application server --- core/Core.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/Core.php b/core/Core.php index 57632b827..a340abeff 100644 --- a/core/Core.php +++ b/core/Core.php @@ -116,7 +116,8 @@ if(!isset($_SERVER['HTTP_HOST'])) { * Fix HTTP_HOST from reverse proxies */ if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { - $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; + // Get the first host, in case there's multiple separated through commas + $_SERVER['HTTP_HOST'] = strtok($_SERVER['HTTP_X_FORWARDED_HOST'], ','); } }