From b5b9c120fa0ea482b2a686be6dbc78597a562689 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Fri, 8 Oct 2010 14:21:35 +0300 Subject: [PATCH] Safety in case of missing methods --- services/dispatcher/midgard3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/dispatcher/midgard3.php b/services/dispatcher/midgard3.php index 7d5072f..d1b24d5 100644 --- a/services/dispatcher/midgard3.php +++ b/services/dispatcher/midgard3.php @@ -236,11 +236,11 @@ private function dispatch_route(midgardmvc_core_request $request, array $argumen // Run the route and set appropriate data try { + $controller->data = array(); if (!method_exists($controller, $action_method)) { throw new midgardmvc_exception_httperror("{$request_method} method not allowed", 405); } - $controller->data = array(); $controller->$action_method($arguments); } catch (Exception $e)