From 84eec155deb84b9c51a2193ca3531f1eb1a3d88c Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 17 Feb 2019 16:57:03 +0100 Subject: [PATCH] only empty the certificates if there's actually something to empty Signed-off-by: Michael Kaufmann --- install/updates/froxlor/0.10/update_0.10.inc.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 93a21f61..62ef696c 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -207,12 +207,14 @@ if (\Froxlor\Froxlor::isDatabaseVersion('201902120')) { showUpdateStep("Removing current Let's Encrypt certificates due to new implementation of acme.sh"); $sel_result = Database::query("SELECT id FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `letsencrypt` = '1'"); $domain_ids = $sel_result->fetchAll(\PDO::FETCH_ASSOC); - $domain_in = ""; - foreach ($domain_ids as $domain_id) { - $domain_in .= "'".$domain_id['id']."',"; + if (count($domain_ids) > 0) { + $domain_in = ""; + foreach ($domain_ids as $domain_id) { + $domain_in .= "'" . $domain_id['id'] . "',"; + } + $domain_in = substr($domain_in, 0, - 1); + Database::query("DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` IN (" . $domain_in . ")"); } - $domain_in = substr($domain_in, 0, -1); - Database::query("DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` IN (". $domain_in . ")"); lastStepStatus(0); \Froxlor\Froxlor::updateToDbVersion('201902170');