mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Do not add the server port when sitting behind a proxy.
Assume that Http-X-Forwarded-Host is set correctly
This commit is contained in:
@@ -69,14 +69,14 @@ function get_absolute_root_url($with_scheme=true)
|
||||
else
|
||||
{
|
||||
$url .= $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
if ( (!$is_https && $_SERVER['SERVER_PORT'] != 80)
|
||||
||($is_https && $_SERVER['SERVER_PORT'] != 443))
|
||||
{
|
||||
$url_port = ':'.$_SERVER['SERVER_PORT'];
|
||||
if (strrchr($url, ':') != $url_port)
|
||||
if ( (!$is_https && $_SERVER['SERVER_PORT'] != 80)
|
||||
||($is_https && $_SERVER['SERVER_PORT'] != 443))
|
||||
{
|
||||
$url .= $url_port;
|
||||
$url_port = ':'.$_SERVER['SERVER_PORT'];
|
||||
if (strrchr($url, ':') != $url_port)
|
||||
{
|
||||
$url .= $url_port;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user