chg: Changed the default bootstrap to not append port 80 / port 443 in any case

- it was causing issues for a user using a rather exotic configuration
pull/1185/head
Iglocska 2016-05-27 16:47:06 +02:00
parent 044755fe07
commit 3df0ec60af
1 changed files with 7 additions and 10 deletions

View File

@ -95,17 +95,14 @@ if (!$relativePaths) {
if (!Configure::read('MISP.baseurl') && isset($serverName)) {
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)) {
if (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 443 || !$appendPort) {
Configure::write('MISP.baseurl', sprintf('https://%s', $serverName));
} else {
Configure::write('MISP.baseurl', sprintf('https://%s:%d', $serverName, $_SERVER['SERVER_PORT']));
}
$protocol = 'https';
} else {
if (!isset($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80 || !$appendPort) {
Configure::write('MISP.baseurl', sprintf('http://%s', $serverName));
} else {
Configure::write('MISP.baseurl', sprintf('http://%s:%d', $serverName, $_SERVER['SERVER_PORT']));
}
$protocol = 'http';
}
if (!isset($_SERVER['SERVER_PORT']) || !in_array($_SERVER['SERVER_PORT'], array(443, 80)) || !$appendPort) {
Configure::write('MISP.baseurl', sprintf('https://%s', $serverName));
} else {
Configure::write('MISP.baseurl', sprintf('https://%s:%d', $serverName, $_SERVER['SERVER_PORT']));
}
}
}