}
$u = User::newFromName( $this->mUsername );
+ if ( $u === false ) {
+ return self::ILLEGAL;
+ }
+ $msg = null;
// Give extensions a way to indicate the username has been updated,
// rather than telling the user the account doesn't exist.
if ( !Hooks::run( 'LoginUserMigrated', array( $u, &$msg ) ) ) {
return self::USER_MIGRATED;
}
- if ( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
+ if ( !User::isUsableName( $u->getName() ) ) {
return self::ILLEGAL;
}
// Give general extensions, such as a captcha, a chance to abort logins
$abort = self::ABORTED;
- $msg = null;
if ( !Hooks::run( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$msg ) ) ) {
$this->mAbortLoginErrorMsg = $msg;