Skip to content
Snippets Groups Projects
Commit 911e947f authored by Christian Berendt's avatar Christian Berendt
Browse files

check if used bucket name is valid

parent dc8ca00f
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,10 @@ class AmazonS3 extends \OC\Files\Storage\Common { ...@@ -75,6 +75,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
)); ));
} }
if (! $this->connection->isValidBucketName($this->bucket)) {
throw new \Exception();
}
if ( ! $this->connection->doesBucketExist($this->bucket)) { if ( ! $this->connection->doesBucketExist($this->bucket)) {
$result = $this->connection->createBucket(array( $result = $this->connection->createBucket(array(
'Bucket' => $this->bucket 'Bucket' => $this->bucket
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment