Avoid fatal on login if username is invalid title
[lhc/web/wiklou.git] / includes / specials / SpecialUserlogin.php
index baced16..5d5a771 100644 (file)
@@ -430,7 +430,7 @@ class LoginForm {
                # TODO: Allow some magic here for invalid external names, e.g., let the
                # user choose a different wiki name.
                $u = User::newFromName( $this->mName );
-               if( is_null( $u ) || !User::isUsableName( $u->getName() ) ) {
+               if( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
                        return self::ILLEGAL;
                }