Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/Sorting/SortSetOperationComparisons.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace BookStack\Sorting;

use voku\helper\ASCII;
use BookStack\Entities\Models\Chapter;
use BookStack\Entities\Models\Entity;

Expand All @@ -13,12 +14,12 @@ class SortSetOperationComparisons
{
public static function nameAsc(Entity $a, Entity $b): int
{
return strtolower($a->name) <=> strtolower($b->name);
return strtolower(ASCII::to_transliterate($a->name)) <=> strtolower(ASCII::to_transliterate($b->name));
}

public static function nameDesc(Entity $a, Entity $b): int
{
return strtolower($b->name) <=> strtolower($a->name);
return strtolower(ASCII::to_transliterate($b->name)) <=> strtolower(ASCII::to_transliterate($a->name));
}

public static function nameNumericAsc(Entity $a, Entity $b): int
Expand Down
2 changes: 2 additions & 0 deletions tests/Sorting/SortRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public function test_name_alphabetical_ordering()
$namesToAdd = [
"Beans",
"bread",
"Éclaire",
"egg",
"Milk",
"pizza",
"Tomato",
Expand Down