Index: trunk/phase3/includes/User.php |
— | — | @@ -354,8 +354,10 @@ |
355 | 355 | $validate = 'valid'; |
356 | 356 | } |
357 | 357 | $name = self::getCanonicalName( $name, $validate ); |
358 | | - if ( $name === false ) { |
359 | | - return null; |
| 358 | + if ( WikiError::isError( $name ) ) { |
| 359 | + return $name; |
| 360 | + } elseif ( $name === false ) { |
| 361 | + return false; |
360 | 362 | } else { |
361 | 363 | # Create unloaded user object |
362 | 364 | $u = new User; |
— | — | @@ -693,7 +695,7 @@ |
694 | 696 | # with title normalisation, but then it's too late to |
695 | 697 | # check elsewhere |
696 | 698 | if( strpos( $name, '#' ) !== false ) |
697 | | - return false; |
| 699 | + return new WikiError( 'usernamehasherror' ); |
698 | 700 | |
699 | 701 | # Clean up name according to title rules |
700 | 702 | $t = ( $validate === 'valid' ) ? |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -267,6 +267,11 @@ |
268 | 268 | # Now create a dummy user ($u) and check if it is valid |
269 | 269 | $name = trim( $this->mName ); |
270 | 270 | $u = User::newFromName( $name, 'creatable' ); |
| 271 | + if ( WikiError::isError( $u ) ) { |
| 272 | + $this->mainLoginForm( wfMsg( $u->getMessage() ) ); |
| 273 | + return false; |
| 274 | + } |
| 275 | + |
271 | 276 | if ( is_null( $u ) ) { |
272 | 277 | $this->mainLoginForm( wfMsg( 'noname' ) ); |
273 | 278 | return false; |