From 0d7fa5728c7a228d887c0522c7978a1fa1577114 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 14 Apr 2019 08:13:34 +0200 Subject: [PATCH] fix auto-delete of cetificates when no domain exists anylonger, thx to an error-report Signed-off-by: Michael Kaufmann --- ssl_certificates.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ssl_certificates.php b/ssl_certificates.php index 008c7474..7a699a78 100644 --- a/ssl_certificates.php +++ b/ssl_certificates.php @@ -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; }