followup r103467 - Make sure we pass a user object when we call LoginAuthenticateAudi...
authorMark A. Hershberger <mah@users.mediawiki.org>
Fri, 16 Dec 2011 17:19:45 +0000 (17:19 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Fri, 16 Dec 2011 17:19:45 +0000 (17:19 +0000)
includes/specials/SpecialUserlogin.php

index 7bf3b75..8ca3095 100644 (file)
@@ -524,7 +524,11 @@ class LoginForm extends SpecialPage {
                # TODO: Allow some magic here for invalid external names, e.g., let the
                # user choose a different wiki name.
                $u = User::newFromName( $this->mUsername );
-               if( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
+               if( !( $u instanceof User ) ) {
+                       wfRunHooks( 'LoginAuthenticateAudit', array( new User, $this->mPassword, self::ILLEGAL ) );
+                       return self::ILLEGAL;
+               }
+               if( !User::isUsableName( $u->getName() ) ) {
                        wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::ILLEGAL ) );
                        return self::ILLEGAL;
                }