fixing bug in Hash where array is not similar to the path required

This commit is contained in:
dogmatic69 2012-12-14 22:45:52 +00:00
parent 6f5ff4d7dd
commit 2266292594
2 changed files with 4 additions and 1 deletions

View file

@ -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);
}
/**

View file

@ -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;
}