* (bug 22664) Special:Userrights now accepts '0' as a valid user name
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 1 Mar 2010 21:01:26 +0000 (21:01 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 1 Mar 2010 21:01:26 +0000 (21:01 +0000)
RELEASE-NOTES
includes/specials/SpecialUserrights.php

index 2238e7b..06e0c01 100644 (file)
@@ -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 ==
 
index 36caf9a..20471e2 100644 (file)
@@ -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 );
                        }