Private GIT

Skip to content
Snippets Groups Projects
Unverified Commit 6f42d090 authored by Gary Allan's avatar Gary Allan
Browse files

Revised baseurl logic for reverse proxies pt2 #3296

parent aac78e66
No related branches found
No related tags found
No related merge requests found
......@@ -997,7 +997,12 @@ class Common_functions {
$url = $_SERVER['SERVER_NAME'];
}
// If only HTTP_X_FORWARDED_PROTO='https' is set assume port=443. Override if required by setting HTTP_X_FORWARDED_PORT
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && !isset($_SERVER['HTTP_X_FORWARDED_PORT'])) {
$port = ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 443 : 80;
} else {
$port = is_numeric($_SERVER['HTTP_X_FORWARDED_PORT']) ? $_SERVER['HTTP_X_FORWARDED_PORT'] : $_SERVER['SERVER_PORT'];
}
if (($proto == "http" && $port == 80) || ($proto == "https" && $port == 443)) {
return "$proto://$url";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment