Skip to content

Commit 1ba0d26

Browse files
committed
Sort Rules: Updated name comparison to not ignore non-ascii chars
Related to #5550 and #5542
1 parent abe7467 commit 1ba0d26

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/Sorting/SortSetOperationComparisons.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ class SortSetOperationComparisons
1414
{
1515
public static function nameAsc(Entity $a, Entity $b): int
1616
{
17-
return strtolower(ASCII::to_transliterate($a->name)) <=> strtolower(ASCII::to_transliterate($b->name));
17+
return strtolower(ASCII::to_transliterate($a->name, null)) <=> strtolower(ASCII::to_transliterate($b->name, null));
1818
}
1919

2020
public static function nameDesc(Entity $a, Entity $b): int
2121
{
22-
return strtolower(ASCII::to_transliterate($b->name)) <=> strtolower(ASCII::to_transliterate($a->name));
22+
return strtolower(ASCII::to_transliterate($b->name, null)) <=> strtolower(ASCII::to_transliterate($a->name, null));
2323
}
2424

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

tests/Sorting/SortRuleTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ public function test_name_alphabetical_ordering()
200200
"bread",
201201
"Éclaire",
202202
"egg",
203+
"É😀ire",
204+
"É🫠ire",
203205
"Milk",
204206
"pizza",
205207
"Tomato",

0 commit comments

Comments
 (0)