Page MenuHomePhabricator

User list includes MediaWiki:Viewprevnext without rendering markup.
Open, LowPublic

Description

At MediaWiki.org, we have modified MediaWiki:Viewprevnext [1] so that the lists are more clearly delineated. This works on all pages that use it (e.g. Special:Uncategorizedcategories [2]) except for the user list page [3]. On the other pages, the <span> tags are treated as HTML, as you would expect, but on the user list they are rendered as straight text.

Expected behaviour: The message should be treated in the same way by all pages that use it.

[1] http://www.mediawiki.org/wiki/MediaWiki:Viewprevnext
[2] http://www.mediawiki.org/wiki/Special:Uncategorizedcategories
[3] http://www.mediawiki.org/wiki/Special:Listusers


Version: 1.21.x
Severity: minor

Details

Reference
bz11454

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:00 PM
bzimport set Reference to bz11454.
bzimport added a subscriber: Unknown Object (MLST).

btw - To save someone else the bother, I checked all the special pages and that was the only one that seemed to have a problem.

Oops - I just noticed that Special:Categories [1] has the same problem. Perhaps my checking was not as thorough as it should have been...

[1] http://www.mediawiki.org/w/index.php?title=Special:Categories

As the wiki is active, and some special pages were broken by the test cases, the problem edit has been deleted at MediaWiki.org. I have instead reproduced the examples at test.wikipedia.org. The links above should therefore be replaced with:

From the description:
[1] http://test.wikipedia.org/wiki/MediaWiki:Viewprevnext
[2] http://test.wikipedia.org/wiki/Special:Uncategorizedcategories
[3] http://test.wikipedia.org/wiki/Special:Listusers

From comment 2:
[1] http://test.wikipedia.org/w/index.php?title=Special:Categories

(note that some of the above pages are cached, and so may not reflect the modifications until their next update)

*** Bug 12100 has been marked as a duplicate of this bug. ***

All uses of viewprevnext should be escaped properly for output as plaintext with generated links. The ones that are currently passing through raw HTML are incorrect and need to be fixed.

It may be appropriate to automatically wrap a <div> with a class around it, though.

Definitely needs a classed DIV tag, along with the fix for consistency - currently it is impossible to style this element.

aliter wrote:

I expect Wiki:WhatLinksHere would be another page with this problem. At least, we're seeing
"(foargeande 50) (folgjende 50) besjen.&gt;br&lt; (20 | 50 | 100 | 250 | 500)", rather than
"(foargeande 50) (folgjende 50) besjen.<br> (20 | 50 | 100 | 250 | 500)".

aliter wrote:

Sorry, I don't have documentation for MediaZilla, so I had to guess whether it would interpret the input one level. Given the look of being a MediaWiki I assumed "yes", and it turns out to be "no". Here we go again:

I expect Wiki:WhatLinksHere would be another page with this problem. At
least, we're seeing
"(foargeande 50) (folgjende 50) besjen.<br> (20 | 50 | 100 | 250 | 500)",
rather than
"(foargeande 50) (folgjende 50) besjen.
(20 | 50 | 100 | 250 | 500)".

I looked around and the bug seems to be fixed now. Am I right? Should we close this bug?

Luis: Thanks for th heads-up!

(In reply to comment #0)

At MediaWiki.org, we have modified MediaWiki:Viewprevnext [1] so that the
lists
are more clearly delineated.

Page does not exist anymore, hence nowadays hard to understand what the modification was. Closing as RESOLVED WORKSFORME for the time being.

This is not resolved, as far as I can see.

The original issue reported was:

  • Most pages (e.g. Special:UncategorizedCategories) output MediaWiki:Viewprevnext message as raw HTML.
  • Some pages, such as Special:ListUsers escape this message before outputting it.
  • Any page that escapes the message should be updated to output it as raw HTML.
  • The impetus for this is that on MediaWiki.org we want to apply styling to the message and whilst this works on most pages, on the ListUsers page the <span> that we wrap the output in is escaped, and so is visible on the page.

Since this bug was logged two things have happened:

  1. It has been stated that this is intentional behaviour, and that the message should always be escaped.
  2. The test case which demonstrated the problem has been removed from test.wikipedia.org. (Here is a link to the deleted version: http://test.wikipedia.org/w/index.php?title=MediaWiki:Viewprevnext&action=edit&oldid=28703). Splarka's comment in the edit history ("sick of people reporting this") implies that this is a relatively common issue, and therefore something that should be resolved one way or another.

So therefore we need to update the bug report as follows:

  • Most pages (e.g. Special:UncategorizedCategories) output MediaWiki:Viewprevnext message as raw HTML.
  • Some pages, such as Special:ListUsers escape this message before outputting it.
  • Any page that *doesn't* escape this message should be updated so that it does, for consistency (this may or may not have been done - hard to tell - and possibly it should be a separate bug).
  • Whenever MW outputs this message it should always be wrapped in a <span> tag with an appropriate class, so that it is possible to style it in a meaningful way.

Bug in Language.php: function viewPrevNext.

Make 'next' link

$next = wfMessage( 'nextn' )->inLanguage( $this )->title( $title )->numParams( $limit )->text();
if ( $atend ) {
$nlink = htmlspecialchars( $next );
} else {
$nlink = $this->numLink( $title, $offset + $limit, $limit,

		$query, $next, 'prevn-title', 'mw-nextlink' );

}

Should be
$nlink = $this->numLink( $title, $offset + $limit, $limit,

		$query, $next, 'nextn-title', 'mw-nextlink' );

Andrey, would you like to create a Gerrit account and put that patch in Gerrit?

Alex, I would like, but I don't know how to do it.

sumanah wrote:

Andrey, thank you for offering to help! If you need additional help in order to put your change into our source code, you can talk with us in our 24-hour chat channel, MediaWiki-General on Freenode IRC. More information: https://www.mediawiki.org/wiki/MediaWiki_on_IRC

Andrey: Are you still up to try getting your patch into the code review system? Did you receive some help on IRC?