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 <gerard.alvear@logiqd.me>
This commit is contained in:
Gerard Alvear Porras
2026-07-11 17:35:33 +02:00
committed by GitHub
parent e95243ae68
commit e24ac6f21c

View File

@@ -233,7 +233,9 @@ class FreshRSS_TagDAO extends Minz_ModelPdo {
$res = $this->fetchAssoc($sql);
if ($res !== null) {
/** @var list<array{id:int,name:string,unreads:int}> $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));