mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fix currentRoute() when $_currentRoute is empty, return false
This commit is contained in:
parent
509b2b1e44
commit
720dc5e8c0
1 changed files with 2 additions and 1 deletions
|
@ -1093,7 +1093,8 @@ class Router {
|
|||
* @return CakeRoute Matching route object.
|
||||
*/
|
||||
public static function currentRoute() {
|
||||
return self::$_currentRoute[count(self::$_currentRoute) - 1];
|
||||
$count = count(self::$_currentRoute) - 1;
|
||||
return ($count >= 0) ? self::$_currentRoute[$count] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue