Improve Pico::getBaseUrl() code styling
This commit is contained in:
parent
38d2dd2e20
commit
81821e7811
1 changed files with 6 additions and 7 deletions
13
lib/Pico.php
13
lib/Pico.php
|
@ -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'] =
|
||||
|
|
Loading…
Reference in a new issue