Skip to content

Commit 26bed5b

Browse files
committed
Fix: compatibility with proxies that extends HTTP_X_FORWARDED_HOST
1 parent a18e4cf commit 26bed5b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Saml2/Utils.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
use Exception;
2626

2727
/**
28-
<<<<<<< HEAD
29-
* Utils of PHP Toolkit
30-
=======
3128
* Utils of SAML PHP Toolkit
32-
>>>>>>> f338e1e... Remove references to onelogin support.
3329
*
3430
* Defines several often used methods
3531
*/
@@ -515,7 +511,7 @@ protected static function getRawHost()
515511
if (self::$_host) {
516512
$currentHost = self::$_host;
517513
} elseif (self::getProxyVars() && array_key_exists('HTTP_X_FORWARDED_HOST', $_SERVER)) {
518-
$currentHost = $_SERVER['HTTP_X_FORWARDED_HOST'];
514+
$currentHost = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST'])[0];
519515
} elseif (array_key_exists('HTTP_HOST', $_SERVER)) {
520516
$currentHost = $_SERVER['HTTP_HOST'];
521517
} elseif (array_key_exists('SERVER_NAME', $_SERVER)) {

0 commit comments

Comments
 (0)