Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 2266292594f1a795019982b40b82a6ae15339689 1 parent 6f5ff4d
@dogmatic69 dogmatic69 authored
View
3  lib/Cake/Test/Case/Utility/HashTest.php
@@ -659,6 +659,9 @@ public function testExtractBasic() {
$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
2  lib/Cake/Utility/Hash.php
@@ -117,7 +117,7 @@ public static function extract(array $data, $path) {
}
foreach ($context[$_key] as $item) {
- foreach ($item as $k => $v) {
+ foreach ((array)$item as $k => $v) {
if (self::_matchToken($k, $token)) {
$next[] = $v;
}
Please sign in to comment.
Something went wrong with that request. Please try again.