ZF-61: RewriteRouter does not correctly handle the default action


"If the foreach fails to locate a route then $controller, $action and $params will be unset and will throw errors."

It was introduced by commenting out a default route in the process of moving the class out of the proposals to the incubator. The simple fix is to add defaults for those variables just before the foreach loop:

$controller = 'index'; $action = 'noRoute';

And/or setting a sufficient default - like that one for instance:

$router->addRoute('default', ':controller/:action', array('action' => 'index'));

This way we'll make it compatible with current router.


No comments to display