Skip to content

Commit 6fb9594

Browse files
committed
Fix php 7.4 substr can return false
1 parent 1393c18 commit 6fb9594

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Authentication/Passwords/PwnedValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public function check(string $password, ?User $user = null): Result
3535
{
3636
$hashedPword = strtoupper(sha1($password));
3737
$rangeHash = substr($hashedPword, 0, 5);
38-
$searchHash = (string) substr($hashedPword, 5);
38+
/** @var string $searchHash */
39+
$searchHash = substr($hashedPword, 5);
3940

4041
try {
4142
$client = Services::curlrequest([

0 commit comments

Comments
 (0)