Last modified: 2014-02-28 16:50:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T63944, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 61944 - Slashes in titles should be escaped when generating links
Slashes in titles should be escaped when generating links
Status: UNCONFIRMED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.23.0
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-26 10:47 UTC by Sebastiano Vigna
Modified: 2014-02-28 16:50 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sebastiano Vigna 2014-02-26 10:47:37 UTC
Some Wikipedia pages contain slashes in their title, e.g., "/b/" or "/dev/null". Such slashes should be escaped to %2F when they are not meant to separate paths components, as per RFC 1738/3986. Instead, for instance,

http://en.wikipedia.org/w/index.php?title=B/&redirect=no

contains an A element

<a href="/wiki//b/" title="/b/">/b/</a>

that should written

<a href="/wiki/%2Fb%2F" title="/b/">/b/</a>


This causes 2 problems:

1) The URL above does not conform to the RFCs. This is a minor issue but it might rise other problems in the future.

2) If the slash is initial, the URI is not normalized as per RFC. E.g., in Java

bsh % print(URI.create("wiki//b/").normalize());
wiki/b/

This might be a problem with crawlers, which usually normalize URLs to reduce the number of duplicates.



Note that %2F-escaped slashes work perfectly, and 

http://en.wikipedia.org/wiki/%2Fb%2F

brings you exactly to /b/'s page. Bug 8254 seems to say the opposite, but it's a few years old.
Comment 1 Andre Klapper 2014-02-26 12:23:31 UTC
Thanks for taking the time to report this!

It's not entirely clear to me what "should be escaped when generating links" mean. The user (when using classic text wikipage editing) or VisualEditor (when using VE for wikipage editing) cannot knowwhich kind of slash is meant.

Or did you mean "when generating wiki page titles" instead?
Comment 2 Sebastiano Vigna 2014-02-26 12:44:00 UTC
What I mean is that the Wikipedia text contains links like [[/b/]]. That is, the user will input the title of a page. But then some code will turn this title into a link: it shouldn't be http://en.wikipedia.org/wiki//b/, but rather http://en.wikipedia.org/wiki/%2Fb%2F . 

Maybe the page above wasn't a good example. Consider

http://en.wikipedia.org/wiki/Cory_Doctorow

The reference entry for /usr/bin/god in the "Other" section is

* ''[[/usr/bin/god]]'' (novel; Tor Books)

The link generated by the Wikimedia software (or whoever is in charge :) is

<a href="/wiki//usr/bin/god" title="/usr/bin/god">/usr/bin/god</a>

This should be

<a href="/wiki/%2Fusr%2Fbin%2Fgod" title="/usr/bin/god">/usr/bin/god</a>

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links