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 committed 2021-01-13 22:44:09 +00:00
1 parent 7dcca5d58a
commit 72ded8494a
1 file changed
+7 -2
+7 -2
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);
}