From: Brian Wolff Date: Tue, 15 Nov 2016 03:44:49 +0000 (+0000) Subject: Use different varname for upgraded hash from original hash X-Git-Tag: 1.31.0-rc.0~4833^2 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=55c1a53cef1018e398267570c1c9db89c97cf0dd;p=lhc%2Fweb%2Fwiklou.git Use different varname for upgraded hash from original hash I found this confusing when reading the code. This should have identical logic but slightly clearer. Change-Id: I4918c29bd5dca3642de7bb60219fc246299d952d --- diff --git a/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php b/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php index 88df68d310..24124a92d2 100644 --- a/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php @@ -132,12 +132,12 @@ class LocalPasswordPrimaryAuthenticationProvider // @codeCoverageIgnoreStart if ( $this->getPasswordFactory()->needsUpdate( $pwhash ) ) { - $pwhash = $this->getPasswordFactory()->newFromPlaintext( $req->password ); - \DeferredUpdates::addCallableUpdate( function () use ( $pwhash, $oldRow ) { + $newHash = $this->getPasswordFactory()->newFromPlaintext( $req->password ); + \DeferredUpdates::addCallableUpdate( function () use ( $newHash, $oldRow ) { $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'user', - [ 'user_password' => $pwhash->toString() ], + [ 'user_password' => $newHash->toString() ], [ 'user_id' => $oldRow->user_id, 'user_password' => $oldRow->user_password