Fixed issue in _validateRouteClass where setting defaultRouteClass back to CakeRoute would throw an exception

This commit is contained in:
Tigran Gabrielyan 2012-07-25 14:13:25 -07:00
parent 7d74f3e598
commit 851aa8bef4

View file

@ -182,7 +182,10 @@ class Router {
* @throws RouterException
*/
protected static function _validateRouteClass($routeClass) {
if (!class_exists($routeClass) || !is_subclass_of($routeClass, 'CakeRoute')) {
if (
$routeClass != 'CakeRoute' &&
(!class_exists($routeClass) || !is_subclass_of($routeClass, 'CakeRoute'))
) {
throw new RouterException(__d('cake_dev', 'Route classes must extend CakeRoute'));
}
return $routeClass;