User:Tamzin/urlencode
I have discovered a minor glitch in a certain combination of magic words. I am not sure how far it extends, but the most relevant effect I've found so far is in userboxes that are intended to link to a URL containing the username of the user whose page they're placed on. The most frequent and significant occurrence of this is user-right userboxes. Below is a demonstration of the error, using a substituted and un-categorized version of my own rollback userbox as an example.
In the current version, clicking "verify" takes you to the wrong link for any users with ampersands in their names. This is a problem for any user who a) has an ampersand in their username and b) is not the first user, alphabetically, to have a name starting with the string of characters up to and including the ampersand (I've created the account User:Francophonie&Aardvark so as to make myself such a user, for demonstrative purposes). This happens because {{tld|urlencode:{{BASEPAGNAME}}
percent-encodes the HTML of the username, instead of the plain text. This userbox now conflates me with an aardvark:
This user has rollback rights on the English Wikipedia. (verify) |
("Verify" link: http://en.wikipedia.org/w/index.php?title=Special:ListUsers&limit=1&username=Francophonie%26%2338%3BAndrophilie)
The solution is to use {{BASEPAGENAMEE}}
(with an extra E at the end) instead of {{urlencode:
. See? I am no longer an aardvark!:
{{BASEPAGENAME}}
}}
This user has rollback rights on the English Wikipedia. (verify) |
("Verify" link: http://en.wikipedia.org/w/index.php?title=Special:ListUsers&limit=1&username=Francophonie%26Androphilie)