Adding a check for HTTP_X_FORWARDED_PROTO in ui_get_full_url()

This commit is contained in:
Ian Blenke 2018-03-29 10:56:26 -04:00
parent fbbc070b39
commit ecf21f1f45
1 changed files with 4 additions and 0 deletions

View File

@ -2325,6 +2325,10 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
$port = null; // null means 'use the starndard port'
$proxy = false; //By default Pandora FMS doesn't run across proxy.
if(isset ($_SERVER['HTTP_X_FORWARDED_PROTO'])
&& $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$_SERVER['HTTPS'] = 'on';
}
if (isset ($_SERVER['HTTPS'])
&& ($_SERVER['HTTPS'] === true
|| $_SERVER['HTTPS'] == 'on')) {