Browse files

fix currentRoute() when $_currentRoute is empty, return false

  • Loading branch information...
1 parent 509b2b1 commit 720dc5e8c03e25310b94a265c08165dc7df179ba @zoghal zoghal committed Apr 26, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Cake/Routing/Router.php
View
3 lib/Cake/Routing/Router.php
@@ -1093,7 +1093,8 @@ public static function requestRoute() {
* @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;
}
/**

0 comments on commit 720dc5e

Please sign in to comment.