Page MenuHomePhabricator

Suppressed username appears weird when viewing history
Closed, ResolvedPublic

Description

modescreenshottext
mobile
4A334F74-6BBB-43A4-9373-DD4CCE907E88.png (2×1 px, 287 KB)
see below (table breaks)
desktop
E0D93A86-D92A-4791-AD7C-7733BAB564E8.png (2×1 px, 678 KB)
(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:

Screen Shot 2018-11-22 at 8.49.29 AM.png (455×1 px, 49 KB)

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 updated the task description. (Show Details)
Jdlrobson subscribed.

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 subscribed.

I will submit a patch for this.

Jdlrobson lowered the priority of this task from Medium 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

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