Improve Pico::getBaseUrl() code styling

This commit is contained in:
Daniel Rudolf 2015-11-27 19:28:48 +01:00
parent 38d2dd2e20
commit 81821e7811

View file

@ -1214,14 +1214,13 @@ class Pico
return $baseUrl;
}
if (
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
|| ($_SERVER['SERVER_PORT'] == 443)
|| (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
) {
$protocol = 'http';
if (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off')) {
$protocol = 'https';
} elseif ($_SERVER['SERVER_PORT'] == 443) {
$protocol = 'https';
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) {
$protocol = 'https';
} else {
$protocol = 'http';
}
$this->config['base_url'] =