diff --git a/library/Icinga/Web/Controller/Dispatcher.php b/library/Icinga/Web/Controller/Dispatcher.php index d1e0bdb82..c96805fa1 100644 --- a/library/Icinga/Web/Controller/Dispatcher.php +++ b/library/Icinga/Web/Controller/Dispatcher.php @@ -4,7 +4,6 @@ namespace Icinga\Web\Controller; use Exception; -use LogicException; use Zend_Controller_Dispatcher_Standard; use Zend_Controller_Request_Abstract; use Zend_Controller_Response_Abstract; @@ -19,8 +18,10 @@ class Dispatcher extends Zend_Controller_Dispatcher_Standard /** * Dispatch request to a controller and action * - * @param Zend_Controller_Request_Abstract $request - * @param Zend_Controller_Response_Abstract $resposne + * @param Zend_Controller_Request_Abstract $request + * @param Zend_Controller_Response_Abstract $response + * + * @throws Exception If dispatching the request fails */ public function dispatch(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response) { @@ -41,11 +42,7 @@ class Dispatcher extends Zend_Controller_Dispatcher_Standard return; } $controller = new $controllerClass($request, $response, $this->getParams()); - $actionName = $request->getActionName(); - if (! $actionName) { - throw new LogicException('Action name not found'); - } - $actionName = $actionName . 'Action'; + $action = $this->getActionMethod($request); $request->setDispatched(true); // Buffer output by default $disableOb = $this->getParam('disableOutputBuffering'); @@ -54,7 +51,7 @@ class Dispatcher extends Zend_Controller_Dispatcher_Standard ob_start(); } try { - $controller->dispatch($actionName); + $controller->dispatch($action); } catch (Exception $e) { // Clean output buffer on error $curObLevel = ob_get_level();