From 09c20b6acdd3fda09afadbe229f14995480e4c1b Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 1 Mar 2010 21:01:26 +0000 Subject: [PATCH] * (bug 22664) Special:Userrights now accepts '0' as a valid user name --- RELEASE-NOTES | 1 + includes/specials/SpecialUserrights.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2238e7bf06..06e0c01575 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -29,6 +29,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN settings changed * (bug 22606) The body of e-mail address confirmation message is now different when the address changed +* (bug 22664) Special:Userrights now accepts '0' as a valid user name == API changes in 1.17 == diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 36caf9a6cd..20471e20f7 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -49,7 +49,7 @@ class UserrightsPage extends SpecialPage { // any groups, it's a bit silly to give them the user search prompt. global $wgUser, $wgRequest, $wgOut; - if( $par ) { + if( $par !== null ) { $this->mTarget = $par; } else { $this->mTarget = $wgRequest->getVal( 'user' ); @@ -67,7 +67,7 @@ class UserrightsPage extends SpecialPage { $available = $this->changeableGroups(); - if ( !$this->mTarget ) { + if ( $this->mTarget === null ) { /* * If the user specified no target, and they can only * edit their own groups, automatically set them as the @@ -121,7 +121,7 @@ class UserrightsPage extends SpecialPage { } // show some more forms - if( $this->mTarget ) { + if( $this->mTarget !== null ) { $this->editUserGroupsForm( $this->mTarget ); } } @@ -291,7 +291,7 @@ class UserrightsPage extends SpecialPage { } } - if( $name == '' ) { + if( $name === '' ) { return new WikiErrorMsg( 'nouserspecified' ); } @@ -311,7 +311,7 @@ class UserrightsPage extends SpecialPage { } } else { $name = User::getCanonicalName( $name ); - if( !$name ) { + if( $name === false ) { // invalid name return new WikiErrorMsg( 'nosuchusershort', $username ); } -- 2.20.1