X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUser.php;h=e25bc1fc1007f7a55311c14dd28595cf256c9548;hb=c1bf30c2e55a7bae04b3c5e232f5017ed79bbd80;hp=989701306dffb6604b64c055facc5927d1a0221b;hpb=b4c68577cb3102e0ed5d2b664f589cd1a4975776;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/User.php b/includes/User.php index 989701306d..e25bc1fc10 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2351,11 +2351,7 @@ class User implements IDBAccessObject { $this->setToken(); $passwordFactory = self::getPasswordFactory(); - if ( $str === null ) { - $this->mPassword = $passwordFactory->newFromCiphertext( null ); - } else { - $this->mPassword = $passwordFactory->newFromPlaintext( $str ); - } + $this->mPassword = $passwordFactory->newFromPlaintext( $str ); $this->mNewpassword = $passwordFactory->newFromCiphertext( null ); $this->mNewpassTime = null; @@ -2400,14 +2396,11 @@ class User implements IDBAccessObject { public function setNewpassword( $str, $throttle = true ) { $this->loadPasswords(); + $this->mNewpassword = self::getPasswordFactory()->newFromPlaintext( $str ); if ( $str === null ) { - $this->mNewpassword = ''; $this->mNewpassTime = null; - } else { - $this->mNewpassword = self::getPasswordFactory()->newFromPlaintext( $str ); - if ( $throttle ) { - $this->mNewpassTime = wfTimestampNow(); - } + } elseif ( $throttle ) { + $this->mNewpassTime = wfTimestampNow(); } }