diff --git a/library/Icinga/Application/webrouter.php b/library/Icinga/Application/webrouter.php index 9f0498e08..552a0b4a8 100644 --- a/library/Icinga/Application/webrouter.php +++ b/library/Icinga/Application/webrouter.php @@ -16,12 +16,17 @@ if (array_key_exists('ICINGAWEB_CONFIGDIR', $_ENV)) { $configDir = '/etc/icingaweb'; } -// TODO: Detect aliases! $baseDir = $_SERVER['DOCUMENT_ROOT']; $ruri = $_SERVER['REQUEST_URI']; +$remove = dirname($_SERVER['PHP_SELF']); + +if (substr($ruri, 0, strlen($remove)) !== $remove) { + return false; +} + +$ruri = substr($ruri, strlen($remove)); list($path, $params) = preg_split('/\?/', $ruri, 2); $ruriParts = preg_split('~/~', ltrim($ruri, '/')); - if (count($ruriParts) === 2 && ($ruriParts[0] === 'css' || $ruriParts[0] === 'js') ) {