fix: revert to relative paths only for requests coming via the command line

- baseurl not auto-resolved if the $_SERVER['SERVER_ADDR'] isn't populated
- solves issues with background workers executing requests on an instance where no baseurl is set
pull/1147/head
Iglocska 2016-05-19 08:35:00 +02:00
parent 2b1d352073
commit 83a912fa47
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ Configure::load('config');
$appendPort = true;
if (!Configure::read('MISP.baseurl')) {
if (!Configure::read('MISP.baseurl') && isset($_SERVER['SERVER_ADDR'])) {
if (isset($_SERVER['SERVER_NAME'])) $serverName = $_SERVER['SERVER_NAME'];
else if (isset($_SERVER['HTTP_HOST'])) $serverName = $_SERVER['HTTP_HOST'];
else $serverName = $_SERVER['SERVER_ADDR'];