File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 22
33namespace BookStack \Sorting ;
44
5+ use voku \helper \ASCII ;
56use BookStack \Entities \Models \Chapter ;
67use BookStack \Entities \Models \Entity ;
78
@@ -13,12 +14,12 @@ class SortSetOperationComparisons
1314{
1415 public static function nameAsc (Entity $ a , Entity $ b ): int
1516 {
16- return strtolower ($ a ->name ) <=> strtolower ($ b ->name );
17+ return strtolower (ASCII :: to_transliterate ( $ a ->name )) <=> strtolower (ASCII :: to_transliterate ( $ b ->name ) );
1718 }
1819
1920 public static function nameDesc (Entity $ a , Entity $ b ): int
2021 {
21- return strtolower ($ b ->name ) <=> strtolower ($ a ->name );
22+ return strtolower (ASCII :: to_transliterate ( $ b ->name )) <=> strtolower (ASCII :: to_transliterate ( $ a ->name ) );
2223 }
2324
2425 public static function nameNumericAsc (Entity $ a , Entity $ b ): int
Original file line number Diff line number Diff line change @@ -198,6 +198,8 @@ public function test_name_alphabetical_ordering()
198198 $ namesToAdd = [
199199 "Beans " ,
200200 "bread " ,
201+ "Éclaire " ,
202+ "egg " ,
201203 "Milk " ,
202204 "pizza " ,
203205 "Tomato " ,
You can’t perform that action at this time.
0 commit comments