BUGFIX: fixing core error that occurs when there are two or more proxy servers in front of the SilverStripe application server

This commit is contained in:
Julian Seidenberg 2012-04-13 17:28:20 +12:00 committed by Ingo Schommer
parent 4d64946a48
commit 523c19e88a

View File

@ -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'], ',');
}
}