Ignore case by sorting
authorCyperghost <olaf_schmitz_1@t-online.de>
Mon, 19 Feb 2024 14:15:30 +0000 (15:15 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 19 Feb 2024 14:15:30 +0000 (15:15 +0100)
wcfsetup/install/files/lib/data/DatabaseObject.class.php

index e10b77003521f07c680fc1e3bdddc7cfae385d77..1bb5e6cbea04528c34e80aab1e2ccc4889da9689 100644 (file)
@@ -237,14 +237,24 @@ abstract class DatabaseObject implements IIDObject, IStorableObject
 
         if ($maintainIndexAssociation) {
             $objects = [];
-            \array_multisort($sortArray, $sortOrder == 'ASC' ? \SORT_ASC : \SORT_DESC, $objects2);
+            \array_multisort(
+                $sortArray,
+                $sortOrder == 'ASC' ? \SORT_ASC : \SORT_DESC,
+                \SORT_NATURAL | \SORT_FLAG_CASE,
+                $objects2
+            );
 
             $objects = [];
             foreach ($objects2 as $idx => $obj) {
                 $objects[\substr($idx, 0, -1)] = $obj;
             }
         } else {
-            \array_multisort($sortArray, $sortOrder == 'ASC' ? \SORT_ASC : \SORT_DESC, $objects);
+            \array_multisort(
+                $sortArray,
+                $sortOrder == 'ASC' ? \SORT_ASC : \SORT_DESC,
+                \SORT_NATURAL | \SORT_FLAG_CASE,
+                $objects
+            );
         }
     }
 }