"William Allen Simpson"
Locke Cole wrote:
William Allen Simpson wrote:
[{{fullurl:Special:Whatlinkshere/{{{1}}}{{{2}}}|limit=999}} links]
Always works.
Because it's part of the full URL generated (see below).
Look it is carefully. It uses a / to indicate the parameter, yet when you use the navigation bar, it generates: http://en.wikipedia.org/w/index.php?title= Special:Whatlinkshere&target=User%3AWilliam_Allen_Simpson
I just tried hand typing: http://en.wikipedia.org/w/index.php?title= Special:Whatlinkshere/User%3AWilliam_Allen_Simpson
So, both forms work, and I'm guessing that the slash form was created as a workaround for the parsing issue.
Have into accont that you can use the slash form with a simple wiki link [[Special:Whatlinkshere/User:William_Allen_Simpson]] while {{fullurl is intended to use when you need to pass extra parameter which cannot be created with wiki links, so you need a full url syntax.
And speaking of syntax, why {{fullurl: instead of {{#fullurl: to match the latest parser syntax?
Probably because the latter would break existing pages relying upon {{fullurl: ...}}. Also, my understanding of {{# was that it was only used for parser extensions (not built-in magic words/functions).
The "{{#if:" started using the standard PHP "if", although it now is a variant more like CPP #ifdef.
I'm not clear on the difference between parser extensions and magic functions. But I've not really looked at the code yet....
Magic words are like environment variables. Parser extensions are functions called by a spell-word.
Anyways, getting back to the problem of spaces in parameters, I don't think URL encoding parameters would work. A better solution (IMO) would be to add two new magic words:
{{urlencode:<string>}} {{urldecode:<string>}}
Which would allow us to encode/decode URL parameters as necessary. Now if a dev could be convinced this is wise, we'd be set. =)
But urlencode and urldecode (and rawurlencode and rawurldecode) are PHP functions. They don't work the way we'd like, they encode spaces as '+' "for historical reasons" (that is, M$ visual basic), while we need '_'.
You can use then str_replace(urlencode(<whatever>), "+", "_"); If there were plus signs into whatever they would've been %aged so you're using a urlencode-like function which replaces spaces into underscores.
What does MS VB have to do into it? The + sign is defined as a valid space encoding at RFCs.
AFAIK, at the beginning, a way to encode a space was needed in order to avoid it mistanding with the separator for the HTTP version field on the request. Then more symbols needed escaping, thus developing the more advanced %hex way, having the + form a %20 synonim.