Skip to content
This repository
Browse code

BUGFIX: fixing core error that occurs when there are two or more prox…

…y servers in front of the SilverStripe application server
  • Loading branch information...
commit 523c19e88a9972f402d0803dff0df123e8d8b7c1 1 parent 4d64946
Julian Seidenberg authored April 13, 2012 chillu committed April 27, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  core/Core.php
3  core/Core.php
@@ -116,7 +116,8 @@
116 116
 	 * Fix HTTP_HOST from reverse proxies
117 117
 	 */
118 118
 	if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
119  
-		$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
  119
+		// Get the first host, in case there's multiple separated through commas
  120
+		$_SERVER['HTTP_HOST'] = strtok($_SERVER['HTTP_X_FORWARDED_HOST'], ',');
120 121
 	}
121 122
 }
122 123
 

0 notes on commit 523c19e

Please sign in to comment.
Something went wrong with that request. Please try again.