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:
phpnut 2007-07-02 21:27:20 +00:00
parent 3880f9ce13
commit 072ed9581f

View file

@ -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);
} }