Skip to content
Snippets Groups Projects
Commit 9dfaa511 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Fix: _buildPort HTTP_X_FORWARDED_PORT not set if forwarded port is 80, return...

Fix: _buildPort HTTP_X_FORWARDED_PORT not set if forwarded port is 80, return 80 as default if HTTP_FORWARDED_HOST is set
parent c2c86666
No related branches found
No related tags found
No related merge requests found
...@@ -195,10 +195,15 @@ class Url ...@@ -195,10 +195,15 @@ class Url
private static function _buildPort() private static function _buildPort()
{ {
return array_key_exists('HTTP_X_FORWARDED_PORT', $_SERVER) if(array_key_exists('HTTP_X_FORWARDED_PORT', $_SERVER)) {
? $_SERVER['HTTP_X_FORWARDED_PORT'] : $_SERVER['SERVER_PORT']; return $_SERVER['HTTP_X_FORWARDED_PORT'];
} else if (array_key_exists('HTTP_X_FORWARDED_HOST', $_SERVER)) {
return '80';
} else {
return $_SERVER['SERVER_PORT'];
}
} }
private static function _buildProto() private static function _buildProto()
{ {
if (array_key_exists('HTTP_X_FORWARDED_PROTO', $_SERVER)) { if (array_key_exists('HTTP_X_FORWARDED_PROTO', $_SERVER)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment