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; 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'] =