Page MenuHomePhabricator

Can't create a username with multiple spaces in it (should fail better or something)
Closed, ResolvedPublic

Description

Filing a bug mostly because I don't know what to do about it.

Tried to create an account named "tst login" (note double space). This failed due to the check:

$parsed = Title::newFromText( $name );
if( is_null( $parsed )
        || $parsed->getNamespace()
        || strcmp( $name, $parsed->getPrefixedText() ) ) {

Which is meant to detect namespace prefixes. (the third part checks if its equal to its normalization, and fails if not)

We should probably just give a warning if the user name normalizes to something different then typed. We should also more generally be specific why things fail.


Version: 1.22.0
Severity: normal

Details

Reference
bz29621

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 11:36 PM
bzimport set Reference to bz29621.
Bawolff created this task.Jun 28 2011, 3:29 AM

Still valid, generic error message is "You have not specified a valid user name".

(In reply to Bawolff (Brian Wolff) from comment #0)

We should probably just give a warning if the user name normalizes to
something different then typed. We should also more generally be specific
why things fail.

This part is bug 61416.

Change 114379 had a related patch set uploaded by Bartosz Dziewoński:
User: Be less stringent in getCanonicalName()

https://gerrit.wikimedia.org/r/114379

Change 115329 had a related patch set uploaded by Bartosz Dziewoński:
SpecialUserlogin: Normalize username before passing to User::newFromName

https://gerrit.wikimedia.org/r/115329

Change 114379 abandoned by Bartosz Dziewoński:
User: Be less stringent in getCanonicalName()

Reason:
Different, maybe less clean, but definitely less scary approach: https://gerrit.wikimedia.org/r/115329

https://gerrit.wikimedia.org/r/114379

Change 115329 merged by jenkins-bot:
SpecialUserlogin: Normalize username before passing to User::newFromName

https://gerrit.wikimedia.org/r/115329