better "if base64" check.

This commit is contained in:
Greyscale 2024-02-26 16:12:39 +01:00
parent 47935b3b49
commit 0405b2a4d5
No known key found for this signature in database
GPG key ID: 74BAFF55434DA4B2

View file

@ -448,7 +448,7 @@ class Bouncer
case 'BOUNCER_CUSTOM_NGINX_CONFIG':
// If envval is base64 encoded, decode it first
if (base64_encode(base64_decode($envVal, true)) === $envVal) {
if (preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $envVal)) {
$envVal = base64_decode($envVal);
}
$this->logger->info('Custom nginx config for {label} is provided.', ['emoji' => Emoji::artistPalette(), 'label' => $bouncerTarget->getLabel()]);