mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +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[] = $data[$k];
|
||||||
|
} else {
|
||||||
|
if (isset($originalKeys[$k])) {
|
||||||
$sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
|
$sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
|
||||||
} else {
|
} else {
|
||||||
$sorted[] = $data[$k];
|
$sorted[$k] = $data[$k];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $sorted;
|
return $sorted;
|
||||||
|
|
Loading…
Reference in a new issue