aboutsummaryrefslogtreecommitdiff
path: root/app/Models/CategoryDAO.php
diff options
context:
space:
mode:
authorGravatar Annika Backstrom <abackstrom@etsy.com> 2025-03-05 13:40:26 +0000
committerGravatar GitHub <noreply@github.com> 2025-03-05 14:40:26 +0100
commitf40acd78cb1f41801c2d398976fbe0e8663f1bd6 (patch)
tree6c28375e392bbaa4a576c2d591f79caf1b50f159 /app/Models/CategoryDAO.php
parent31c797b3fc9712ed2dc0b4e60f616a2a0366e70e (diff)
Use case-insensitive sort for categories (#7402)
Changes proposed in this pull request: - Use `strnatcasecmp()` inside `listSortedCategories()` How to test the feature manually: 1. Create categories `A`, `b`, and `C` 2. Observe that categories are sorted case-insensitively on the feed index and Subscription Management pages
Diffstat (limited to 'app/Models/CategoryDAO.php')
-rw-r--r--app/Models/CategoryDAO.php2
1 files changed, 1 insertions, 1 deletions
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) {