mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-19 18:22:16 +03:00
Merge branch 'bernardo-campos/development' into development
This commit is contained in:
commit
1256320c72
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace BookStack\Sorting;
|
namespace BookStack\Sorting;
|
||||||
|
|
||||||
|
use voku\helper\ASCII;
|
||||||
use BookStack\Entities\Models\Chapter;
|
use BookStack\Entities\Models\Chapter;
|
||||||
use BookStack\Entities\Models\Entity;
|
use BookStack\Entities\Models\Entity;
|
||||||
|
|
||||||
@ -13,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($a->name) <=> strtolower($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($b->name) <=> strtolower($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
|
||||||
|
@ -198,6 +198,10 @@ class SortRuleTest extends TestCase
|
|||||||
$namesToAdd = [
|
$namesToAdd = [
|
||||||
"Beans",
|
"Beans",
|
||||||
"bread",
|
"bread",
|
||||||
|
"Éclaire",
|
||||||
|
"egg",
|
||||||
|
"É😀ire",
|
||||||
|
"É🫠ire",
|
||||||
"Milk",
|
"Milk",
|
||||||
"pizza",
|
"pizza",
|
||||||
"Tomato",
|
"Tomato",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user