block the canonical username
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 11 Jul 2006 09:01:11 +0000 (09:01 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 11 Jul 2006 09:01:11 +0000 (09:01 +0000)
includes/SpecialBlockip.php

index 4ca376b..c7f25b9 100644 (file)
@@ -197,8 +197,11 @@ class IPBlockForm {
                        } else {
                                # Username block
                                if ( $wgSysopUserBans ) {
-                                       $userId = User::idFromName( $this->BlockAddress );
-                                       if ( $userId == 0 ) {
+                                       $user = User::newFromName( $this->BlockAddress );
+                                       if ( $user->getID() ) {
+                                               # Use canonical name
+                                               $this->BlockAddress = $user->getName();
+                                       } else {
                                                $this->showForm( wfMsg( 'nosuchusershort', htmlspecialchars( $this->BlockAddress ) ) );
                                                return;
                                        }