Skip to content

Commit

Permalink
Merge pull request #624 from acidtv/3.3/develop
Browse files Browse the repository at this point in the history
Fixing #623: Arr::map doesn't work with multidimensional array and keys
  • Loading branch information
enov committed Jul 10, 2015
2 parents 0d3cf9b + a226178 commit 98615c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion classes/Kohana/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public static function map($callbacks, $array, $keys = NULL)
{
if (is_array($val))
{
$array[$key] = Arr::map($callbacks, $array[$key]);
$array[$key] = Arr::map($callbacks, $array[$key], $keys);
}
elseif ( ! is_array($keys) OR in_array($key, $keys))
{
Expand Down
16 changes: 16 additions & 0 deletions tests/kohana/ArrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,22 @@ public function provider_map()
'bar' => 'foobar',
),
),
array(
'strip_tags',
array(
array(
'foo' => '<p>foobar</p>',
'bar' => '<p>foobar</p>',
),
),
array('foo'),
array(
array(
'foo' => 'foobar',
'bar' => '<p>foobar</p>',
),
),
),
);
}

Expand Down

0 comments on commit 98615c5

Please sign in to comment.