From e7e1b1a98e9e98dfd6c9f173406c3c3a79d30651 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 28 Aug 2015 13:13:20 +0200 Subject: [PATCH] Dispatcher: Default to the default module if no module has been given in the request This is most likely the case when custom routes have been added to the router w/o the module parameter being set. refs #5786 --- library/Icinga/Web/Controller/Dispatcher.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Controller/Dispatcher.php b/library/Icinga/Web/Controller/Dispatcher.php index 5941eec77..ff3c98848 100644 --- a/library/Icinga/Web/Controller/Dispatcher.php +++ b/library/Icinga/Web/Controller/Dispatcher.php @@ -44,7 +44,8 @@ class Dispatcher extends Zend_Controller_Dispatcher_Standard return; } $controllerName = ucfirst($controllerName) . 'Controller'; - if ($this->_defaultModule === $moduleName = $request->getModuleName()) { + $moduleName = $request->getModuleName(); + if ($moduleName === null || $moduleName === $this->_defaultModule) { $controllerClass = 'Icinga\\' . self::CONTROLLER_NAMESPACE . '\\' . $controllerName; } else { $controllerClass = 'Icinga\\Module\\' . ucfirst($moduleName) . '\\' . self::CONTROLLER_NAMESPACE . '\\'