Last modified: 2008-09-28 01:56:13 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 T14654, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12654 - Users whose names begin with namespace prefixes cannot be renamed
Users whose names begin with namespace prefixes cannot be renamed
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Renameuser (Other open bugs)
unspecified
All All
: Normal major with 1 vote (vote)
: ---
Assigned To: Aaron Schulz
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-16 18:18 UTC by Aryeh Gregor (not reading bugmail, please e-mail directly)
Modified: 2008-09-28 01:56 UTC (History)
4 users (show)

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


Attachments

Description Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-01-16 18:18:22 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?
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-01-16 18:37:06 UTC
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.
Comment 2 Platonides 2008-01-16 18:45:20 UTC
Special:Userrights also works with user ids. Why not make Renameuser work with them, too?
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-01-16 22:48:16 UTC
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.
Comment 4 Siebrand Mazeland 2008-08-18 13:49:52 UTC
Assigned to maintainer (Aaron)
Comment 5 Aaron Schulz 2008-08-18 18:43:40 UTC
Hmm, looking into IDs for these few cases.
Comment 6 Aaron Schulz 2008-09-27 11:20:28 UTC
Should be done in r41304
Comment 7 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-09-28 01:11:28 UTC
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.
Comment 8 Aaron Schulz 2008-09-28 01:42:31 UTC
Fixed in r41328. I can rename Talk:Vandal to Vandal on my testwiki.
Comment 9 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-09-28 01:56:13 UTC
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.

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


Navigation
Links