Fix regression in r45351 "(bug 16044) Vague error message in Special:Emailuser"
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 7 Jan 2009 01:19:36 +0000 (01:19 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 7 Jan 2009 01:19:36 +0000 (01:19 +0000)
Non-existent users and anon addresses were showing "noemail" instead of "notarget" message, since only the invalid name case was now being checked.

includes/specials/SpecialEmailuser.php

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