From e24ac6f21c088f308cfc6da645c8a237cdf144d4 Mon Sep 17 00:00:00 2001 From: Gerard Alvear Porras <55630227+Elgeryy1@users.noreply.github.com> Date: Sat, 11 Jul 2026 17:35:33 +0200 Subject: [PATCH] Sort labels with locale-aware collation (#9023) Labels (tags) were sorted by the database's raw byte/ASCII collation via ORDER BY name, so accented or non-Latin label names sorted after all ASCII names instead of near their base letter. Apply the same FreshRSS_Context::localeCompare() sort used for categories, feeds, and shares (#8985) to TagDAO::listTags(), fixing the last remaining sub-item of this issue; the others were already resolved by #6212. Fixes #6211 Co-authored-by: Gerard Alvear --- app/Models/TagDAO.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/TagDAO.php b/app/Models/TagDAO.php index 55ddb1b8b..d6714d98c 100644 --- a/app/Models/TagDAO.php +++ b/app/Models/TagDAO.php @@ -233,7 +233,9 @@ class FreshRSS_TagDAO extends Minz_ModelPdo { $res = $this->fetchAssoc($sql); if ($res !== null) { /** @var list $res */ - return self::daoToTags($res); + $tags = self::daoToTags($res); + uasort($tags, static fn(FreshRSS_Tag $a, FreshRSS_Tag $b) => FreshRSS_Context::localeCompare($a->name(), $b->name())); + return $tags; } else { $info = $this->pdo->errorInfo(); Minz_Log::error('SQL error ' . __METHOD__ . json_encode($info));