Permalink
Browse files

fix Set::sort() for issue in previous commit

  • Loading branch information...
1 parent beb0474 commit af575027daa081eaca1227c25e8b5a7b5b9d7d1c @rchavik rchavik committed Mar 13, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/Cake/Utility/Set.php
View
@@ -1089,10 +1089,14 @@ public static function sort($data, $path, $dir) {
$keys = array_unique($keys);
foreach ($keys as $k) {
- if (!$numeric) {
- $sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
- } else {
+ if ($numeric) {
$sorted[] = $data[$k];
+ } else {
+ if (isset($originalKeys[$k])) {
+ $sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
+ } else {
+ $sorted[$k] = $data[$k];
+ }
}
}
return $sorted;

0 comments on commit af57502

Please sign in to comment.