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:
parent
7dcca5d58a
commit
72ded8494a
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user