Page MenuHomePhabricator

CheckUser should not hardcode parentheses in the HTML
Closed, ResolvedPublic

Description

The Special:CheckUser page hardcodes '(' and ')' characters in the output. This reduces the ability of a skin to style this and make this content responsive. The two offending elements are the timestamp and roles
e.g.

<li><a href="/wiki/User:DoRD" title="User:DoRD"><bdi>DoRD</bdi></a> <span><span><a href="/wiki/User_talk:DoRD" class="mw-usertoollinks-talk" title="User talk:DoRD">talk</a></span> <span><a href="/wiki/Special:Contributions/DoRD" class="mw-usertoollinks-contribs" title="Special:Contributions/DoRD">contribs</a></span></span>&rlm;&lrm; 

<!-- problem 1-->
(<a href="/wiki/Wikipedia:Edit_filter" title="Wikipedia:Edit filter">abuse filter editor</a>, <a href="/wiki/Wikipedia:CheckUser" title="Wikipedia:CheckUser">check user</a>, <a href="/wiki/Wikipedia:Oversight" title="Wikipedia:Oversight">oversight</a>, <a href="/wiki/Wikipedia:Administrators" title="Wikipedia:Administrators">administrator</a>)

<!-- problem 2-->
 (Created on 17 December 2009 at 03:32)</li>

The new way of doing this is:

<div class=".mw-changeslist-links">Created on 17 December 2009 at 03:32</div>

The visual effect is the same, but it gives skins more flexibility to style.

https://en.wikipedia.org/wiki/Special:RecentChanges, https://en.wikipedia.org/wiki/Special:Contributions and the history pages do not do this and can be used for guidance.

Related tasks

Event Timeline

Ammarpad renamed this task from CheckUser should not hardcode paranthesises in the HTML to CheckUser should not hardcode parentheses in the HTML.Oct 5 2019, 11:46 PM

Hi @Jdlrobson, I would like to work on this task but I noticed the Special:CheckUser page is a restricted page and I don't have the permission to access it. Can I still work on this?

Hey @Zaycodes you'll need to set this up locally to be able to test it and write the code so it shouldn't matter if you can view production .

Try setting up https://m.mediawiki.org/wiki/Extension:CheckUser as a first step and let me know if you run into any problems that I can help with!

Hey @Zaycodes you'll need to set this up locally to be able to test it and write the code so it shouldn't matter if you can view production .

Try setting up https://m.mediawiki.org/wiki/Extension:CheckUser as a first step and let me know if you run into any problems that I can help with!

Thanks @Jdlrobson, will work on that and get back to you

Hi @Jdlrobson, I'm trying to set up mediawiki locally but i keep getting the following error:

Undefined index: UseWindowsAuth in C:\xampp\htdocs\mediawiki-1.33.1\includes\libs\rdbms\database\DatabaseMssql.php on line 75

I need some help on this

Hi @Jdlrobson, I've successfully set up mediawii locally

Congrats! Can you replicate this bug?

Ok I'll see if I can do that and get back to you if I experience any issues

hi @Jdlrobson i have set up the mediawiki locally. I want to work on this issue. please help me how should I get start.

Wrapping the parenthesis and vertical line in a span with a specific class in addition to an alternative for .mw-changeslist-links would solve both, I assume.

  • It can be copied.
  • It can be hidden by skins if needed.

The class used to mark up the parts to be wrapped in parenthesis is: .mw-changeslist-links
This adds ::before , ::after pseudo-elements with a single parenthesis content:,
and .mw-changeslist-links > span:not(:first-child):before with content: ' | ';

There's also .mw-diff-bytes, .mw-uctop also wrapping in parenthesis
and mw-changeslist-separator:empty:before which adds 2 dots.

Status quo:

  • &action=history uses .mw-changeslist-links
  • Special:Log uses both .mw-changeslist-links and inline parenthesis for "thank"
  • Special:RecentChanges: .mw-changeslist-links
  • Special:Contributions: .mw-changeslist-links
  • Special:CheckUser: .mw-changeslist-links
  • more?

hi @Jdlrobson i have set up the mediawiki locally. I want to work on this issue. please help me how should I get start.

Have you managed to get CheckUser working locally? If so can you replicate the bug being described here?

I was able to do so after adding the following to LocalSettings.php and running composer update --no-dev && php maintenance/update.php in the core folder.

wfLoadExtension( 'CheckUser' );
$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;

Once you can do that, you'll want to review the code in https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CheckUser/+/master/includes/specials/SpecialCheckUser.php#1422

Wrapping the parenthesis and vertical line in a span with a specific class in addition to an alternative for .mw-changeslist-links would solve both, I assume.

Please reuse the classes defined in core that mirror the ones used on other pages e.g. Special:RecentChanges rather than creating your own new ones. If we need to create new ones that's a sign that the code in core is not good enough and needs improving.

Thanks in advance for looking into this!

Change 585877 had a related patch set uploaded (by Jdlrobson; owner: saamlegend):
[mediawiki/extensions/CheckUser@master] CheckUser should not hardcode parentheses in the HTML

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

Change 791819 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove hardcoded parentheses in favour of CSS styling

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

I've submitted a patch that builds on @Saamlegend's work here. Although I'm not new to coding, I am new to developing code for wikimedia. Hopefully I've not taken a task that someone else was on, but this seems pretty inactive.

I'm a bit unsure of the XSS problems detected in one of the automatic tests. It seems like this extension hasn't yet been properly checked against Phan and excludes added. It seems in updating the code around it it's caused the checks to run. Running Phan locally there seems to be more than just this for this extension that raises these problems.

Change 585877 abandoned by Majavah:

[mediawiki/extensions/CheckUser@master] CheckUser should not hardcode parentheses in the HTML

Reason:

in favour of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CheckUser/+/791819

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

Change 791819 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove hardcoded parentheses in favour of CSS styling

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

I think this has been done.