From 83a912fa4724f1ff12b3c2e138d3a296265854e2 Mon Sep 17 00:00:00 2001 From: Iglocska Date: Thu, 19 May 2016 08:35:00 +0200 Subject: [PATCH] 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 --- app/Config/bootstrap.default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Config/bootstrap.default.php b/app/Config/bootstrap.default.php index 590fe1630..82582aca7 100644 --- a/app/Config/bootstrap.default.php +++ b/app/Config/bootstrap.default.php @@ -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'];