mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fix Set::sort() for issue in previous commit
This commit is contained in:
parent
beb0474d67
commit
af575027da
1 changed files with 7 additions and 3 deletions
|
@ -1089,10 +1089,14 @@ class Set {
|
||||||
$keys = array_unique($keys);
|
$keys = array_unique($keys);
|
||||||
|
|
||||||
foreach ($keys as $k) {
|
foreach ($keys as $k) {
|
||||||
if (!$numeric) {
|
if ($numeric) {
|
||||||
$sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
|
|
||||||
} else {
|
|
||||||
$sorted[] = $data[$k];
|
$sorted[] = $data[$k];
|
||||||
|
} else {
|
||||||
|
if (isset($originalKeys[$k])) {
|
||||||
|
$sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
|
||||||
|
} else {
|
||||||
|
$sorted[$k] = $data[$k];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $sorted;
|
return $sorted;
|
||||||
|
|
Loading…
Reference in a new issue