Last modified: 2008-09-28 01:56:13 UTC
Per the summary. This is an issue if, for instance, a namespace was added. On dewiki, when the WP: namespace shortcut was added, at least one user's name reportedly became invalid, and he could not be renamed. This is a major bug when it occurs, because there's no possible workaround without shell-user intervention and it completely disables the account.
This requires going through all the SpecialRenameuser.php code and killing the unnecessary use of titles (which is why I opened a bug rather than immediately fixing it). When is $username going to be different from Title::newFromText( $username, NS_USER )->getText()? When $username is lowercase (maybe), when else?
Hmm, it also converts underscores to spaces, etc. How about this: first try creating the object. If that doesn't work, try looking for a DB key *exactly as entered*. Possibly we could have an intermediate step as well, to try looking for the DB key with spaces => underscores and/or some other niceties, but even without that it would still at least be possible to rename users whose names aren't valid titles.
Brion, do you have any thoughts on this? It would be good to get this fixed ASAP, for the poor stranded user on dewiki (although that could be fixed with sysadmin intervention). I see a number of users at <http://en.wikipedia.org/w/index.php?title=Special:Listusers&username=WP%3A>, too, although the only one with a blue user page has that because it houses a sockpuppet template.
Special:Userrights also works with user ids. Why not make Renameuser work with them, too?
Not ideal (or rather, not as a substitute for this), but it would work too, yes. Would still require some modifications, the code works extensively with the username and would have to be adjusted somewhat to work properly with the ID.
Ialex suggested using Title::makeTitleSafe() instead of Title::newFromText(), but this doesn't work: the assumption of a semi-valid user name is built too deep into the User object. Even with no validation specified, User::getCanonicalName() checks that the name is a valid title. This is pretty unexpected if you specify no validation, IMO -- perhaps it should be fixed.
Assigned to maintainer (Aaron)
Hmm, looking into IDs for these few cases.
Should be done in r41304
Doesn't work for me. I'm getting an error 'The user "Talk:Username" does not exist.' when trying to rename a user by that name. This seems to be a problem at line 184 in SpecialRenameuser_body.php. User::newFromName() is apparently stripping the namespace prefix somehow.
Fixed in r41328. I can rename Talk:Vandal to Vandal on my testwiki.
Confirmed fixed for the special case of a namespace prefix. If the username is otherwise an invalid title, it would still fail, but I don't see any way this might happen, so it doesn't seem like a problem. I'll resummarize the bug -- if anyone needs further fixes for names containing invalid characters or something, they can open a new bug.