Merge pull request #739 from tigrang/router-validate-route-fix

Fixed issue where restoring the default route class would cause an exception.
This commit is contained in:
Mark Story 2012-07-25 18:16:21 -07:00
commit a03166c5b6

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;