0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

wrap pacrypt() call with a try/catch to log/handle issues where an exception is thrown - see https://github.com/postfixadmin/postfixadmin/issues/420

This commit is contained in:
David Goodwin 2021-01-13 22:43:05 +00:00
parent a1987a5aa3
commit 30e3132a34

View File

@ -29,8 +29,13 @@ class Login {
if (sizeof($result) == 1) {
$row = $result[0];
$crypt_password = pacrypt($password, $row['password']);
try {
$crypt_password = pacrypt($password, $row['password']);
} catch (\Exception $e) {
error_log("Error while trying to call pacrypt()");
error_log($e);
return false; // just refuse to login?
}
return hash_equals($row['password'], $crypt_password);
}