diff --git a/lib/Cake/Test/Case/Utility/HashTest.php b/lib/Cake/Test/Case/Utility/HashTest.php index a4bce1bcb..e40419794 100644 --- a/lib/Cake/Test/Case/Utility/HashTest.php +++ b/lib/Cake/Test/Case/Utility/HashTest.php @@ -659,6 +659,9 @@ class HashTest extends CakeTestCase { $result = Hash::extract($data, '1.Article.title'); $this->assertEquals(array('Second Article'), $result); + + $result = Hash::extract(array(false), '{n}.Something.another_thing'); + $this->assertEquals(array(), $result); } /** diff --git a/lib/Cake/Utility/Hash.php b/lib/Cake/Utility/Hash.php index 584d4160e..c99175f89 100644 --- a/lib/Cake/Utility/Hash.php +++ b/lib/Cake/Utility/Hash.php @@ -117,7 +117,7 @@ class Hash { } foreach ($context[$_key] as $item) { - foreach ($item as $k => $v) { + foreach ((array)$item as $k => $v) { if (self::_matchToken($k, $token)) { $next[] = $v; }