Page MenuHomePhabricator

right-* messages contain wikitext but User::getRightDescription() returns them as plaintext
Closed, ResolvedPublicBUG REPORT

Description

right-* messages (human-readable definitions of user rights) might contain wikitext (specifically, the change-tag-related ones do), but User::getRightDescription() uses Message::text() to render them. This is not an issue for Special:ListGrants, Special:ListGroupRights and Special:GlobalGroupPermissions which use the method output as parameter for the listgrouprights-right-display message and then parse that message; but other interfaces such as Special:BotPasswords and the OAuth consumer registration form end up showing raw wikitext.

Event Timeline

Tgr triaged this task as Low priority.Jul 12 2022, 12:19 AM
Tgr added a project: good first task.

Perhaps it makes sense to use Message::parse() in directly in User::getRightDescription(). It could be redundant for Special:ListGrants et al. since there is also some parsing happening there but at least it would prevent wikitext from being displayed as raw text. I'll submit a patch in line with this.

Change 981176 had a related patch set uploaded (by African Hope; author: African Hope):

[mediawiki/core@master] Adjust User::getRightDescription to return parsed text

https://gerrit.wikimedia.org/r/981176

Change 981176 merged by jenkins-bot:

[mediawiki/core@master] Split User::getRightDescription into two methods

https://gerrit.wikimedia.org/r/981176