Page MenuHomePhabricator

Sidebar values need to be cleaned before use as the id= value in page source
Closed, ResolvedPublic

Description

The 1st line in MediaWiki:Sidebar is both displayed in the sidebar in some skins, and used as the value in an
id="xxx" html attribute. Special charactes, even spaces, can be present is the data (See sample from ksh Wikipedia
below) and lead to invalid html, since id= attribute values are pretty much restricted to alfanumerics and
underscore only.

Solution: put the string above the side bar as-is, but use a special character filter before outputting the value
of the id=attribute, as is it is done elsewhere, too.

Here the data that made http://validator.w3.org/ complain. (btw. "Jangk noh" translates to "go to")

*Jangk noh
mainpage|mainpage
Category:Houpschublaad|categories
randompage-url|randompage
Special:Newpages|newpages
recentchanges-url|recentchanges
currentevents-url|currentevents
portal-url|portal
sitesupport-url|sitesupport
**helppage|help


Version: unspecified
Severity: minor
URL: http://ksh.wikipedia.org/wiki/MediaWiki:Sidebar

Details

Reference
bz5993

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:13 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz5993.
bzimport added a subscriber: Unknown Object (MLST).

gangleri wrote:

Hallo!

I did run into the same problem at
Bug 2797: [[MediaWiki:Mainpage]] and the other navigation utilities should allow
pipes, &nbsp; <span dir="foo" >

I have seen your changes at
http://ksh.wikipedia.org/w/index.php?title=MediaWiki:Sidebar&action=history

As far as I know the usage of html entities, &#nnnn; &#xnnn; in MediaWiki
messages depends on their type: wikitext, htmltext, if used inside id="foo" etc.
Sometimes Unicode characters must be used but you are right they are not allowed
inside id="foo".

A filter would make sense.

best regards reinhardt [[user:gangleri]]

robchur wrote:

At some point, the values for the sidebar items stopped being message keys
(which generally conform to the requirements) and started supporting literal
page names and URLs.

gangleri wrote:

Hallo!

I suggest to mark this bug as INVALID because there should be documentation
available about how to configure sidebar "properly".

Please see
http://yi.wikipedia.org/wiki/MediaWiki:Sidebar?uselang=en
and
http://yi.wikipedia.org/wiki/MediaWiki_talk:Sidebar?uselang=en#How_does_Sidebar_work.3F.E2.80.8E

I noticed another issue today:
the sidebar is case sensitive:

  • Special:Version|version

is *not* identical with

  • Special:Version|Version

depending on what languages are using to look at the page and what messages are
available in the local wiki:

http://nike.users.idler.fi/dev/index.php?title=MediaWiki%3ASidebar&diff=23139&oldid=22867&uselang=ru
still shows the Finish "Versio" while
http://nike.users.idler.fi/dev/index.php?title=MediaWiki%3ASidebar&diff=23139&oldid=22867&uselang=ro
shows rendering according to the (faulty) local MediaWiki:Version/ro

best regards reinhardt [[user:gangleri]]

After modifying the content of MediaWiki:Sidebar according to comment 3 as follows:

*Navigation
mainpage|mainpage
Category:Houpschublaad|categories
**randompage-url|randompage
... etc. ...

where MediaWiki:Navigation exists, the problem of invalid html is gone, independent of wether or not there are
spaces or special characters in the contents of MediaWiki:Navigation.

I am setting this bug to WONTFIX since there is indeed no real need (though it would not hurt...)

Yet the sidebar config needs to be more clearly documented, see bug 6118.

ayg wrote:

*** This bug has been marked as a duplicate of 7623 ***