check if used bucket name is valid

This commit is contained in:
Christian Berendt 2013-07-08 14:59:09 +02:00
parent dc8ca00f1e
commit 911e947fd7
1 changed files with 4 additions and 0 deletions

View File

@ -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)) {
$result = $this->connection->createBucket(array(
'Bucket' => $this->bucket