Fix yet another instance of comparing the result of User::newFromName to null
authorRoan Kattouw <catrope@users.mediawiki.org>
Sat, 10 Apr 2010 10:08:29 +0000 (10:08 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sat, 10 Apr 2010 10:08:29 +0000 (10:08 +0000)
includes/specials/SpecialEmailuser.php

index 1c16576..6d42f31 100644 (file)
@@ -303,7 +303,7 @@ class EmailUserForm {
                }
 
                $nu = User::newFromName( $nt->getText() );
-               if( is_null( $nu ) || !$nu->getId() ) {
+               if( !$nu instanceof Title || !$nu->getId() ) {
                        wfDebug( "Target is invalid user.\n" );
                        return "notarget";
                } else if ( !$nu->isEmailConfirmed() ) {