Update Crypto.php
Correct return test on `crypt()`. On failure `crypt()` returns a string that is shorter than 13 characters.
This commit is contained in:
parent
2384f4f14a
commit
c0ed2d6fed
6
miniflux/vendor/PicoTools/Crypto.php
vendored
6
miniflux/vendor/PicoTools/Crypto.php
vendored
@ -43,7 +43,7 @@ function password_verify($password, $hash)
|
|||||||
{
|
{
|
||||||
$ret = crypt($password, $hash);
|
$ret = crypt($password, $hash);
|
||||||
|
|
||||||
if (! is_string($ret) || strlen($ret) != strlen($hash) || strlen($ret) <= 13) {
|
if (! is_string($ret) || strlen($ret) != strlen($hash) || strlen($ret) < 13) {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ function password_hash($password)
|
|||||||
|
|
||||||
$ret = crypt($password, $hash);
|
$ret = crypt($password, $hash);
|
||||||
|
|
||||||
if (! is_string($ret) || strlen($ret) <= 13) {
|
if (! is_string($ret) || strlen($ret) < 13) {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -147,4 +147,4 @@ function password_salt($required_salt_len)
|
|||||||
$salt = str_replace('+', '.', base64_encode($buffer));
|
$salt = str_replace('+', '.', base64_encode($buffer));
|
||||||
|
|
||||||
return substr($salt, 0, $required_salt_len);
|
return substr($salt, 0, $required_salt_len);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user