From 2af804c9b3d7ee725f4c409e5264f4d4b68eb005 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 20 May 2006 08:51:59 +0000 Subject: [PATCH] Fix #6018: Special:Userrights -> wrong message when no user was specified Patch by Jimmy Collins --- RELEASE-NOTES | 1 + includes/SpecialUserrights.php | 5 ++++- languages/Messages.php | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 69be18e775..4482458d0f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -302,6 +302,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 5187) Allow programmatically bypassing username validation, for scripts * (bug 6025) SpecialImport: wrong message when no file selected * (bug 6015) EditPage: add spacing in the boxes "edit is minor" and "watch this" +* (bug 6018) Userrights: new message when no user specified ('nouserspecified') == Compatibility == diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index ef65f16587..8f43092cbe 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -145,7 +145,10 @@ class UserrightsForm extends HTMLForm { global $wgOut, $wgUser; $user = User::newFromName($username); - if( is_null( $user ) || $user->getID() == 0 ) { + if( is_null( $user ) ) { + $wgOut->addWikiText( wfMsg( 'nouserspecified' ) ); + return; + } elseif( $user->getID() == 0 ) { $wgOut->addWikiText( wfMsg( 'nosuchusershort', wfEscapeWikiText( $username ) ) ); return; } diff --git a/languages/Messages.php b/languages/Messages.php index c4a0404bdc..57234bd402 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -395,6 +395,7 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen 'loginsuccess' => "'''You are now logged in to {{SITENAME}} as \"$1\".'''", 'nosuchuser' => 'There is no user by the name "$1". Check your spelling, or create a new account.', 'nosuchusershort' => 'There is no user by the name "$1". Check your spelling.', +'nouserspecified' => 'You have to specify a username.', 'wrongpassword' => 'Incorrect password entered. Please try again.', 'wrongpasswordempty' => 'Password entered was blank. Please try again.', 'mailmypassword' => 'E-mail password', -- 2.20.1