Skip to content

Commit 1256320

Browse files
committed
Merge branch 'bernardo-campos/development' into development
2 parents 802f69c + 1ba0d26 commit 1256320

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/Sorting/SortSetOperationComparisons.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace BookStack\Sorting;
44

5+
use voku\helper\ASCII;
56
use BookStack\Entities\Models\Chapter;
67
use 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, null)) <=> strtolower(ASCII::to_transliterate($b->name, null));
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, null)) <=> strtolower(ASCII::to_transliterate($a->name, null));
2223
}
2324

2425
public static function nameNumericAsc(Entity $a, Entity $b): int

tests/Sorting/SortRuleTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ public function test_name_alphabetical_ordering()
198198
$namesToAdd = [
199199
"Beans",
200200
"bread",
201+
"Éclaire",
202+
"egg",
203+
"É😀ire",
204+
"É🫠ire",
201205
"Milk",
202206
"pizza",
203207
"Tomato",

0 commit comments

Comments
 (0)