Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

avoid offset -1 error on tests etc

  • Loading branch information...
commit 2cff67184fdc135045d294b1e8e8d50147674f9c 1 parent 972d575
@dereuromark dereuromark authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/Routing/Router.php
View
4 lib/Cake/Routing/Router.php
@@ -633,8 +633,8 @@ public static function getRequest($current = false) {
* @return array Parameter information
*/
public static function getParams($current = false) {
- if ($current) {
- return self::$_requests[count(self::$_requests) - 1]->params;
+ if ($current && ($count = count(self::$_requests)) > 0) {
+ return self::$_requests[$count - 1]->params;
}
if (isset(self::$_requests[0])) {
return self::$_requests[0]->params;
Please sign in to comment.
Something went wrong with that request. Please try again.