mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
updating Set::map() handling of deeply nested arrays, fixes #3809, thanks to speedmax for an updated test case.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6320 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
83b6be9d60
commit
22cc25e9c5
2 changed files with 10 additions and 3 deletions
|
@ -226,7 +226,7 @@ class Set extends Object {
|
|||
$primary = true;
|
||||
}
|
||||
if (is_numeric($key)) {
|
||||
if (is_object($out) && is_array($value)) {
|
||||
if (is_object($out)) {
|
||||
$out = get_object_vars($out);
|
||||
}
|
||||
$out[$key] = Set::__map($value, $class, true);
|
||||
|
@ -234,7 +234,7 @@ class Set extends Object {
|
|||
$out->_name_ = $key;
|
||||
$primary = false;
|
||||
foreach($value as $key2 => $value2) {
|
||||
$out->{$key2} = Set::__map($value2, $class);
|
||||
$out->{$key2} = Set::__map($value2, true);
|
||||
}
|
||||
} else {
|
||||
$out->{$key} = Set::__map($value, $class);
|
||||
|
|
|
@ -691,6 +691,10 @@ class SetTest extends UnitTestCase {
|
|||
'X-Original-Transfer-Encoding' => "chunked",
|
||||
'Content-Length' => "50210",
|
||||
),
|
||||
'meta' => array(
|
||||
'keywords' => array('testing','tests'),
|
||||
'description'=>'describe me',
|
||||
),
|
||||
'get_vars' => '',
|
||||
'post_vars' => array(),
|
||||
'cookies' => array('PHPSESSID' => "dde9896ad24595998161ffaf9e0dbe2d"),
|
||||
|
@ -714,6 +718,10 @@ class SetTest extends UnitTestCase {
|
|||
'X-Original-Transfer-Encoding' => "chunked",
|
||||
'Content-Length' => "50210",
|
||||
),
|
||||
'meta' => array(
|
||||
'keywords' => array('testing','tests'),
|
||||
'description'=>'describe me',
|
||||
),
|
||||
'get_vars' => '',
|
||||
'post_vars' => array(),
|
||||
'cookies' => array('PHPSESSID' => "dde9896ad24595998161ffaf9e0dbe2d"),
|
||||
|
@ -969,7 +977,6 @@ class SetTest extends UnitTestCase {
|
|||
$result = Set::reverse($xml);
|
||||
$expected = array('Data' => array('Post' => array('title' => 'Title of this post', 'description' => 'cool')));
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue