diff --git a/lib/Cake/Utility/Hash.php b/lib/Cake/Utility/Hash.php index ea514975e..e9605ddc7 100644 --- a/lib/Cake/Utility/Hash.php +++ b/lib/Cake/Utility/Hash.php @@ -250,12 +250,11 @@ class Hash { foreach ($data as $k => $v) { if (self::_matchToken($k, $token)) { - if ($conditions) { - if (self::_matches($v, $conditions)) { - $data[$k] = array_merge($v, $values); - continue; - } - } else { + if ($conditions && self::_matches($v, $conditions)) { + $data[$k] = array_merge($v, $values); + continue; + } + if (!$conditions) { $data[$k] = self::insert($v, $nextPath, $values); } }