]> BookStack Code Mirror - bookstack/blobdiff - app/Sorting/SortSetOperationComparisons.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / app / Sorting / SortSetOperationComparisons.php
index 0d8e582648e3f8113f682233f424631e128d8ede..cb20e1860f76f1a337e7ccc884b1bfee8b068ed7 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace BookStack\Sorting;
 
+use voku\helper\ASCII;
 use BookStack\Entities\Models\Chapter;
 use BookStack\Entities\Models\Entity;
 
@@ -13,12 +14,12 @@ class SortSetOperationComparisons
 {
     public static function nameAsc(Entity $a, Entity $b): int
     {
-        return $a->name <=> $b->name;
+        return strtolower(ASCII::to_transliterate($a->name, null)) <=> strtolower(ASCII::to_transliterate($b->name, null));
     }
 
     public static function nameDesc(Entity $a, Entity $b): int
     {
-        return $b->name <=> $a->name;
+        return strtolower(ASCII::to_transliterate($b->name, null)) <=> strtolower(ASCII::to_transliterate($a->name, null));
     }
 
     public static function nameNumericAsc(Entity $a, Entity $b): int