mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding trigger_error for incorrect class use.
This commit is contained in:
parent
0047ac8f34
commit
626f2e86de
1 changed files with 6 additions and 1 deletions
|
@ -280,7 +280,12 @@ class Router {
|
|||
$routeClass = $options['routeClass'];
|
||||
unset($options['routeClass']);
|
||||
}
|
||||
$self->routes[] =& new $routeClass($route, $defaults, $options);
|
||||
$Route =& new $routeClass($route, $defaults, $options);
|
||||
if ($routeClass !== 'CakeRoute' && !is_subclass_of($Route, 'CakeRoute')) {
|
||||
trigger_error(__('Route classes must extend CakeRoute', true), E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
$self->routes[] =& $Route;
|
||||
return $self->routes;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue