fix auto-delete of cetificates when no domain exists anylonger, thx to an error-report

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann 2019-04-14 08:13:34 +02:00
parent 29365838b3
commit 0d7fa5728c
No known key found for this signature in database
GPG Key ID: 55284EC83A4823B8

View File

@ -106,9 +106,13 @@ if (count($all_certs) == 0) {
if (empty($cert['domain']) || empty($cert['ssl_cert_file'])) {
// no domain found to the entry or empty entry - safely delete it from the DB
Database::pexecute($del_stmt, array(
'id' => $cert['id']
));
try {
Certificates::getLocal($userinfo, array(
'id' => $cert['id']
))->delete();
} catch (Exception $e) {
// do nothing
}
continue;
}