Reject usernames with namespace or interwiki prefixes
authorGergő Tisza <gtisza@wikimedia.org>
Sat, 16 Apr 2016 17:36:33 +0000 (17:36 +0000)
committerGergő Tisza <gtisza@wikimedia.org>
Mon, 18 Apr 2016 14:43:33 +0000 (14:43 +0000)
commitb212197020c6c739bc4e6c0bfceb950a5c7dbdfa
treee73a88b380bac9625653a03d408ef2ba721e14f5
parentbc4e07b6f63b0865a14aef981366a79d10329c87
Reject usernames with namespace or interwiki prefixes

User::getCanonicalName silently stripped namepace/iw prefixes,
resulting in weird behavior (e.g. entering 'Template:Foo' in the
registration form username field was accepted, but user 'Foo' was
created). Explicitly reject such names instead.

Also remove leading whitespace from test cases testing for something
else.

Bug: T94656
Change-Id: Idfb22f998cb069fca24abcf5809afd6e0324b0ae
includes/user/User.php
tests/phpunit/includes/user/UserTest.php