Skip to content

Instantly share code, notes, and snippets.

@tigrang
Created July 25, 2012 19:42
Show Gist options
  • Save tigrang/3178144 to your computer and use it in GitHub Desktop.
Save tigrang/3178144 to your computer and use it in GitHub Desktop.
diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php
index 42a2937..c1956c5 100644
--- a/lib/Cake/Routing/Router.php
+++ b/lib/Cake/Routing/Router.php
@@ -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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment