Skip to content

Commit d217c4d

Browse files
sdespontderrabus
authored andcommitted
Update Pbkdf2PasswordHasher.php
Because https://www.php.net/manual/en/function.hash-pbkdf2.php is expecting string and not ?string. Pertmits avoiding deprecation warning.
1 parent 6dd2daf commit d217c4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Hasher/Pbkdf2PasswordHasher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function hash(string $plainPassword, string $salt = null): string
6969
throw new LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm));
7070
}
7171

72-
$digest = hash_pbkdf2($this->algorithm, $plainPassword, $salt, $this->iterations, $this->length, true);
72+
$digest = hash_pbkdf2($this->algorithm, $plainPassword, $salt ?? '', $this->iterations, $this->length, true);
7373

7474
return $this->encodeHashAsBase64 ? base64_encode($digest) : bin2hex($digest);
7575
}

0 commit comments

Comments
 (0)