Improve Pico::getBaseUrl() code styling
This commit is contained in:
parent
38d2dd2e20
commit
81821e7811
13
lib/Pico.php
13
lib/Pico.php
@ -1214,14 +1214,13 @@ class Pico
|
|||||||
return $baseUrl;
|
return $baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
$protocol = 'http';
|
||||||
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
|
if (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off')) {
|
||||||
|| ($_SERVER['SERVER_PORT'] == 443)
|
$protocol = 'https';
|
||||||
|| (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
|
} elseif ($_SERVER['SERVER_PORT'] == 443) {
|
||||||
) {
|
$protocol = 'https';
|
||||||
|
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) {
|
||||||
$protocol = 'https';
|
$protocol = 'https';
|
||||||
} else {
|
|
||||||
$protocol = 'http';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->config['base_url'] =
|
$this->config['base_url'] =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user