Skip to content

A free, self-hostable news aggregator…

Use case-insensitive sort for categories (#7402)

Annika Backstromf40acd78cb1f
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index 5d191f321..ee0d02d6c 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -265,7 +265,7 @@ SQL;
$aPosition = $a->attributeInt('position');
$bPosition = $b->attributeInt('position');
if ($aPosition === $bPosition) {
- return ($a->name() < $b->name()) ? -1 : 1;
+ return strnatcasecmp($a->name(), $b->name());
} elseif (null === $aPosition) {
return 1;
} elseif (null === $bPosition) {