Page MenuHomePhabricator

Suppressed username appears weird when viewing history
Closed, ResolvedPublic

Description

modescreenshottext
mobile
see below (table breaks)
desktop
(Username or IP removed)

{{#ifeq:{{FULLPAGENAME}}|Special:Contributions| [Username or IP has been suppressed for this edit. As an oversighter you can still see the edit in the user's contributions]|(Username or IP removed)}} when it's supposed to be (Username or IP removed).

Acceptance criteria

  • Switch usages of $this->msg( 'rev-deleted-user' )->plain(); to $this->msg( 'rev-deleted-comment' )->escaped();
  • Switch usages of $this->msg( 'rev-deleted-comment' )->plain(); to $this->msg( 'rev-deleted-comment' )->escaped();
  • Make sure we've done this in all special pages - includes/specials/SpecialMobileContributions.php, includes/specials/SpecialMobileDiff.php and includes/specials/MobileSpecialPageFeed.php

Developer notes

This can be replicated on https://en.m.wikipedia.org/wiki/Special:History/User_talk:Ponyo when anonymous looking at 22 November 2018.

Interestingly, when I view this (as a logged in user) I see:

However when I look in incognito window I see the issue above.

It looks like the message being used has been overridden to use parsed HTML:
https://en.m.wikipedia.org/wiki/MediaWiki:Rev-deleted-user?action=edit

This can be fixed either by community editing that template OR MobileFrontend allowing HTML/wikitext .

To fix in MobileFrontend we'd need to do the following
Edit includes/specials/MobileSpecialPageFeed.php

Replace:

$username = $this->msg( 'rev-deleted-user' )->plain();

with

$username = $this->msg( 'rev-deleted-user' )->escaped();

We should also check the behaviour for $this->msg( 'rev-deleted-comment' )->plain(); and in other pages

Replication steps

{{#ifeq:{{FULLPAGENAME}}|Special:Contributions| [Username or IP has been suppressed for this edit. As an oversighter you can still see the edit in the user's contributions]|(Username or IP removed)}}
  • Enable delete revision for admins
$wgGroupPermissions['sysop']['deleterevision'] = true;
  • See T118864 and give your username surpressor rights
  • As an admin
  • Visit a history page and "Change visibility of selected revision"
  • In incognito visit the history page in mobile to see the problem

Event Timeline

revi created this task.Nov 22 2018, 5:04 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 22 2018, 5:04 AM
revi moved this task from Incoming to Radar on the User-revi board.Nov 22 2018, 5:05 AM
revi updated the task description. (Show Details)Nov 22 2018, 5:08 AM
revi updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)Nov 22 2018, 4:51 PM
Jdlrobson updated the task description. (Show Details)Nov 22 2018, 5:35 PM
Jdlrobson updated the task description. (Show Details)Nov 22 2018, 5:51 PM
Jdlrobson added a subscriber: Jdlrobson.

Okay. this took a while but mission complete. I have updated the ticket with why this is broken.

Heh, interesting that this only occurs on mobile: I had to take a screenshot while logged out since if I were logged in, I will just see the username instead of the bug. Also, it could be oversight, not just sysop-level removal.

Ammarpad added a subscriber: Ammarpad.

I will submit a patch for this.

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptMar 14 2019, 11:44 AM
Jdlrobson removed Ammarpad as the assignee of this task.Apr 9 2019, 4:33 PM
Jdlrobson lowered the priority of this task from Normal to Low.

Change 504500 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/MobileFrontend@master] Allow parsing HTML to fix rendering issue

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

Change 504500 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Allow HTML in some messages to fix rendering issue

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

Jdlrobson closed this task as Resolved.May 1 2019, 7:05 PM

Signing off. Thanks for taking the time to fix this bug @Ammarpad !