mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-19 18:22:16 +03:00
Sort Rules: Updated name comparison to not ignore non-ascii chars
Related to #5550 and #5542
This commit is contained in:
parent
abe7467ae5
commit
1ba0d26fdd
@ -14,12 +14,12 @@ class SortSetOperationComparisons
|
|||||||
{
|
{
|
||||||
public static function nameAsc(Entity $a, Entity $b): int
|
public static function nameAsc(Entity $a, Entity $b): int
|
||||||
{
|
{
|
||||||
return strtolower(ASCII::to_transliterate($a->name)) <=> strtolower(ASCII::to_transliterate($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
|
public static function nameDesc(Entity $a, Entity $b): int
|
||||||
{
|
{
|
||||||
return strtolower(ASCII::to_transliterate($b->name)) <=> strtolower(ASCII::to_transliterate($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
|
public static function nameNumericAsc(Entity $a, Entity $b): int
|
||||||
|
@ -200,6 +200,8 @@ class SortRuleTest extends TestCase
|
|||||||
"bread",
|
"bread",
|
||||||
"Éclaire",
|
"Éclaire",
|
||||||
"egg",
|
"egg",
|
||||||
|
"É😀ire",
|
||||||
|
"É🫠ire",
|
||||||
"Milk",
|
"Milk",
|
||||||
"pizza",
|
"pizza",
|
||||||
"Tomato",
|
"Tomato",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user