From f40acd78cb1f41801c2d398976fbe0e8663f1bd6 Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Wed, 5 Mar 2025 13:40:26 +0000 Subject: 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 --- app/Models/CategoryDAO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Models') 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) { -- cgit v1.2.3