]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(s3): fix handling verify_bucket_exists parameter 40186/head
authorThomas Citharel <tcit@tcit.fr>
Mon, 26 Jun 2023 14:43:07 +0000 (16:43 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Thu, 31 Aug 2023 21:21:16 +0000 (21:21 +0000)
If 'verify_bucket_exists' is set to false in the config.php s3 configuration, it's supposed to avoid
verifying that the bucket exists. However empty(falsy) will  always return true, so this condition
would not work.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
lib/private/Files/ObjectStore/S3ConnectionTrait.php

index deb03571c7624fdae200e6a32eb58520695dd26d..49942b385bcda2cd8ea6b09b14e89e6e25d0fa1f 100644 (file)
@@ -92,7 +92,7 @@ trait S3ConnectionTrait {
                if (!isset($params['port']) || $params['port'] === '') {
                        $params['port'] = (isset($params['use_ssl']) && $params['use_ssl'] === false) ? 80 : 443;
                }
-               $params['verify_bucket_exists'] = empty($params['verify_bucket_exists']) ? true : $params['verify_bucket_exists'];
+               $params['verify_bucket_exists'] = $params['verify_bucket_exists'] ?? true;
                $this->params = $params;
        }