mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-10 19:10:39 +00: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
2 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue