Skip to content

Commit 8f36c18

Browse files
committed
Merge pull request #2138 from barrybingo/development
[Fix] Correctly hash new password
2 parents 02cf3ad + 4e1855c commit 8f36c18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

public/include/classes/user.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ public function resetPassword($token, $new1, $new2) {
861861
$this->setErrorMessage( 'New password is too short, please use more than 8 chars' );
862862
return false;
863863
}
864-
$new_hash = $this->getHash($new1);
864+
$new_hash = $this->getHash($new1, HASH_VERSION, bin2hex(openssl_random_pseudo_bytes(32)));
865865
$stmt = $this->mysqli->prepare("UPDATE $this->table SET pass = ? WHERE id = ?");
866866
if ($this->checkStmt($stmt) && $stmt->bind_param('si', $new_hash, $aToken['account_id']) && $stmt->execute() && $stmt->affected_rows === 1) {
867867
if ($this->token->deleteToken($aToken['token'])) {

0 commit comments

Comments
 (0)