mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding fix for failing tests on php 5
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5374 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
3880f9ce13
commit
072ed9581f
1 changed files with 14 additions and 0 deletions
|
@ -709,8 +709,21 @@ class Set extends Object {
|
||||||
$objectKeys = array_keys($object);
|
$objectKeys = array_keys($object);
|
||||||
$count = count($mergeKeys);
|
$count = count($mergeKeys);
|
||||||
$change = $object;
|
$change = $object;
|
||||||
|
$count1 = count($objectKeys);
|
||||||
|
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
|
$loop = $count1;
|
||||||
|
|
||||||
|
for ($ii = 0; $ii < $loop; $ii++) {
|
||||||
|
if(is_array($object[$objectKeys[$ii]])) {
|
||||||
|
if(array_key_exists($objectKeys[$ii], $object[$objectKeys[$ii]])) {
|
||||||
|
unset($change[$objectKeys[$ii]][$objectKeys[$ii]]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unset($change[$objectKeys[$ii]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($objectKeys as $key => $value) {
|
foreach ($objectKeys as $key => $value) {
|
||||||
if(is_array($object[$value])) {
|
if(is_array($object[$value])) {
|
||||||
if(array_key_exists($mergeKeys[$i], $object[$value])) {
|
if(array_key_exists($mergeKeys[$i], $object[$value])) {
|
||||||
|
@ -720,6 +733,7 @@ class Set extends Object {
|
||||||
unset($change[$value]);
|
unset($change[$value]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$object = Set::pushDiff($change, $merge);
|
$object = Set::pushDiff($change, $merge);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue