Skip to content

Commit 4638b30

Browse files
authored
Fix: compatibility with proxies that extends HTTP_X_FORWARDED_HOST
1 parent 0c2c34a commit 4638b30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Saml2/Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ protected static function getRawHost()
494494
if (self::$_host) {
495495
$currentHost = self::$_host;
496496
} elseif (self::getProxyVars() && array_key_exists('HTTP_X_FORWARDED_HOST', $_SERVER)) {
497-
$currentHost = $_SERVER['HTTP_X_FORWARDED_HOST'];
497+
$currentHost = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST'])[0];
498498
} elseif (array_key_exists('HTTP_HOST', $_SERVER)) {
499499
$currentHost = $_SERVER['HTTP_HOST'];
500500
} elseif (array_key_exists('SERVER_NAME', $_SERVER)) {

0 commit comments

Comments
 (0)