mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03: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:
1 parent
7dcca5d58a
commit
72ded8494a
1 file changed
+7
-2
+7
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user