Last modified: 2010-05-15 15:33:11 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 T3192, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1192 - space char in template parameter is not converted to %20
space char in template parameter is not converted to %20
Status: RESOLVED DUPLICATE of bug 839
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
1.4.x
PC All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://meta.wikimedia.org/wiki/Templa...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-24 20:25 UTC by Nathan Cheng
Modified: 2010-05-15 15:33 UTC (History)
0 users

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


Attachments

Description Nathan Cheng 2004-12-24 20:25:13 UTC
According to the documentation at

    http://meta.wikimedia.org/wiki/Templates#External_links

when a template parameter is part of a URL, any spaces in the value of the parameter are 
automatically converted to %20 so that the URL is properly rendered, i.e. the URL is not ended. 
However, the examples contained in the documentation demonstrate that this automatic conversion 
does _not_ in fact happen--at least in the version of MediaWiki on which the documentation is 
running.
Comment 1 Brion Vibber 2004-12-24 21:03:32 UTC
I'm not sure who wrote that or why, it doesn't seem to be true and I'd be very surprised if it were.

Tested on 1.3.8 and 1.4 current.

Marking... invalid? Not sure. Reopen if you get more information.
Comment 2 Nathan Cheng 2004-12-25 01:50:31 UTC
According to the Meta home page it is running 1.4beta3.

Maybe I am retarded or just sleep-deprived, but did you check out the link in the bug description? The 
documentation expressly states that:

"A blank space in a parameter value or template content that is substituted in a URL is not taken as 
ending the URL, but converted to %20."

But look at the first example in the "Examples" section that follows this statement. It passes the 
parameters:

   insert in target
   insert in label

to the template:

   tle

The template tle is defined as follows:

   [http://a{{{1}}}b c{{{2}}}d]

Now, according to the documentation, this should render HTML that looks like this:

   <a href="http://ainsert%20in%20targetb">cinsert in labeld</a>

But the html that gets rendered is not even close; it is this:

   <a href="http://ainsert">in targetb cinsert in labeld</a>

This is cleary caused by the space chars in the first parameter "insert in target" NOT being replaced by %
20's as they should be and as the documentation claims they are.
Comment 3 Brion Vibber 2004-12-25 01:55:03 UTC
(In reply to comment #2)
> Maybe I am retarded or just sleep-deprived, but did you 
check out the link in the bug description? The 
> documentation expressly states that:

I certainly did: as I explained, this "documentation" does not 
match the observed behavior of the system. I confirmed also 
that the observed behavior on 1.4beta3 is the same on 1.3.8.

From this I draw the conclusion that the page's description 
probably was not correct before the upgrade either. I 
therefore cannot explain why someone wrote that description. 
We will require additional information, such as a confirmation 
that it really did ever work like that.
Comment 4 Nathan Cheng 2004-12-25 02:16:11 UTC
Oh, I must be sleep-deprived...when you said, "I don't know who wrote that...", I thought you were talking 
about me logging this as a bug.

One this is for sure: It sure would be nice if space chars were converted to %20 in URLs. This would make 
the templating functionality a lot more useful. See the OtherVersionsExt template embedded on this page:

http://217.160.248.24/randy/wikibible/mediawiki-1.3.7/index.php?title=WikiBibleMerge:Bible_Versions

for an example of where this would be really useful and why I want to use it. The workaround is that I have 
to pass two params--one with spaces, one with %20s.
Comment 5 Brion Vibber 2005-01-29 08:03:55 UTC
The template replacement doesn't know that you're putting something into a URL.

Resolving as a duplicate of bug 839, an enhancement request for an explicit way to URL-encode things like template 
parameters.

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

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


Navigation
Links