Skip to content

Commit 7c6b5d7

Browse files
committed
Passwords: BCRYPT changed to default algorithm
Warning: the result in a database column can expand beyond 60 characters!
1 parent 1a281ec commit 7c6b5d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Security/Passwords.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Passwords
2929
/**
3030
* See http://php.net/manual/en/password.constants.php
3131
*/
32-
public function __construct(int $algo = PASSWORD_BCRYPT, array $options = [])
32+
public function __construct(int $algo = PASSWORD_DEFAULT, array $options = [])
3333
{
3434
$this->algo = $algo;
3535
$this->options = $options;

tests/Security/Passwords.hash().phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require __DIR__ . '/../bootstrap.php';
1414

1515

1616
Assert::truthy(
17-
preg_match('#^\$2.\$\d\d\$.{53}\z#', (new Passwords)->hash(''))
17+
preg_match('#^\$.{50,}\z#', (new Passwords)->hash(''))
1818
);
1919

2020
Assert::truthy(

0 commit comments

Comments
 (0)