diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-03-01 15:46:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 15:46:04 +0300 |
commit | df55781814f07afaaca437310e3f667aa78c1d2a (patch) | |
tree | 7473f62444fedf5b1d0c2a8dfa26b2d0bbfe068b | |
parent | d0d1c85deffe225911c4e87b631389e056468cc6 (diff) | |
parent | e3142a91b229d9f11b5df1f1b33dfe5d67b5f761 (diff) |
Merge pull request #14254 from sparrowjack63/master
Dont check Bucket Name in Nextcloud
-rw-r--r-- | lib/private/Files/ObjectStore/S3ConnectionTrait.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index feca792848e..b2bb6d706e0 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -100,16 +100,19 @@ trait S3ConnectionTrait { $this->connection = new S3Client($options); if (!$this->connection->isBucketDnsCompatible($this->bucket)) { - throw new \Exception("The configured bucket name is invalid: " . $this->bucket); + $logger = \OC::$server->getLogger(); + $logger->debug('Bucket "' . $this->bucket . '" This bucket name is not dns compatible, it may contain invalid characters.', + ['app' => 'objectstore']); } if (!$this->connection->doesBucketExist($this->bucket)) { $logger = \OC::$server->getLogger(); try { $logger->info('Bucket "' . $this->bucket . '" does not exist - creating it.', ['app' => 'objectstore']); - $this->connection->createBucket(array( - 'Bucket' => $this->bucket - )); + if (!$this->connection->isBucketDnsCompatible($this->bucket)) { + throw new \Exception("The bucket will not be created because the name is not dns compatible, please correct it: " . $this->bucket); + } + $this->connection->createBucket(array('Bucket' => $this->bucket)); $this->testTimeout(); } catch (S3Exception $e) { $logger->logException($e, [ |