Page MenuHomePhabricator

space in external links
Closed, ResolvedPublic

Description

Author: lambdav

Description:
Sometimes we get parameter containing space character in their value. For example: MediaWiki:Sp-contributions-footer using $1 for the user name when this user name contain a space character.

When this value need to be in an external link, there is no possibility to create the correct link :

  • using the wiki syntax [ ] the link is broken at the first space character
  • using the HTML a tag is not possible (displayed as raw text)

Version: 1.12.x
Severity: enhancement

Details

Reference
bz11729

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:57 PM
bzimport set Reference to bz11729.
bzimport added a subscriber: Unknown Object (MLST).

lambdav wrote:

It's not about literal links, but using $1 :
example:

[http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=$1&dbname=frwikibooks_p Statistiques détaillées]

where $1 is replaced by MediaWiki with the username, and this username contains a space character

robchur wrote:

There should be a URL-encoding parser function for this purpose, either {{urlencode}} or {{#urlencode}} (can't remember which).

lambdav wrote:

I already tried {{urlencode:$1}} -> %241
and some other solutions, all failed.

See the history of MediaWiki:Sp-contributions-footer [http://fr.wikibooks.org/w/index.php?title=MediaWiki:Sp-contributions-footer&action=history]