fix language-strings; disallow direct removing of certificates if issuer=lets encrypt; fix sql query in updater; porting nginx regex for vhost-merging

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-09-12 15:25:47 +02:00
parent 6ad1ca2ba9
commit 3fc18f9903
6 changed files with 12 additions and 10 deletions

View File

@@ -863,13 +863,7 @@ class Nginx extends HttpConfigBase
// remove comments
$vhost = implode("\n", preg_replace('/^(\s+)?#(.*)$/', '', explode("\n", $vhost)));
// Break blocks into lines
$vhost = str_replace([
"{",
"}"
], [
" {\n",
"\n}"
], $vhost);
$vhost = preg_replace("/^(\s+)?location(.+)\{(.+)\}$/misU", "location $2 {\n $3 \n}", $vhost);
// Break into array items
$vhost = explode("\n", preg_replace('/[ \t]+/', ' ', trim(preg_replace('/\t+/', '', $vhost))));
// Remove empty lines

View File

@@ -47,4 +47,9 @@ class SSLCertificate
}
return false;
}
public static function isNotLetsEncrypt(array $attributes): bool
{
return (int)$attributes['fields']['letsencrypt'] == 0;
}
}

View File

@@ -89,6 +89,9 @@ return [
'action' => 'delete',
'id' => ':id'
],
// Let's Encrypt certificates can be removed 'correctly'
// by disabling let's encrypt for the domain
'visible' => [SSLCertificate::class, 'isNotLetsEncrypt']
],
]
]