From 6628cbee302b0638413ae001ec937a9a2dcaacf5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 11 Jul 2006 09:01:11 +0000 Subject: [PATCH] block the canonical username --- includes/SpecialBlockip.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 4ca376b465..c7f25b964b 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -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; } -- 2.20.1