From: S Page Date: Fri, 8 Feb 2013 07:46:27 +0000 (-0800) Subject: fix logic introduced in addNewAccountInternal X-Git-Tag: 1.31.0-rc.0~20751^2 X-Git-Url: http://git.cyclocoop.org//%22%22.url_de_base%28%29.%22/%22?a=commitdiff_plain;h=3f1fd4328b4ffc10579570052b4fb0557058de0e;p=lhc%2Fweb%2Fwiklou.git fix logic introduced in addNewAccountInternal Jenkins' PHP codesniffer complains about the whitespace at line 318. I'm pretty sure gerrit 17952 (commit 69ea4400) introduced bad logic. Part of the if statement boils down to userExists( userName || authenticate( userName, password) ) if userName is falsy then it calls userExists on the boolean return value of authenticate(). I think this change puts it back to the way it was. Change-Id: If334464ffa993490abe8919591a18a4c3935bcfb --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 63d101b8ee..705f14f2c8 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -314,8 +314,10 @@ class LoginForm extends SpecialPage { if( 'local' != $this->mDomain && $this->mDomain != '' ) { if( !$wgAuth->canCreateAccounts() && - ( !$wgAuth->userExists( $this->mUsername || - !$wgAuth->authenticate( $this->mUsername, $this->mPassword ) ) ) + ( + !$wgAuth->userExists( $this->mUsername ) || + !$wgAuth->authenticate( $this->mUsername, $this->mPassword ) + ) ) { return Status::newFatal( 'wrongpassword' ); }