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:
@@ -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
|
||||
|
||||
@@ -47,4 +47,9 @@ class SSLCertificate
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function isNotLetsEncrypt(array $attributes): bool
|
||||
{
|
||||
return (int)$attributes['fields']['letsencrypt'] == 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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']
|
||||
],
|
||||
]
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user