followup r103467 - Make sure we pass a user object when we call LoginAuthenticateAudi...
[lhc/web/wiklou.git] / 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;
                }