summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-10-23 12:42:42 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-10-23 12:42:42 +0200
commit7c14a173619cce5c3f637888865e0786a727f5c8 (patch)
tree32604c934e0a7e8927b0f078fd3d13d8ae1f948d /apps/files_external
parentca01530f57c08d588f444f0d73ca7748d37dd107 (diff)
parent71dce48bd3f4d75156be30670f2e6752c0cb97c5 (diff)
downloadnextcloud-server-7c14a173619cce5c3f637888865e0786a727f5c8.tar.gz
nextcloud-server-7c14a173619cce5c3f637888865e0786a727f5c8.zip
Merge pull request #11721 from owncloud/fix-s3-regression
[master] Fix S3 connection regression
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/amazons3.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index 52255fb559e..1869f1b15c2 100644
--- a/apps/files_external/lib/amazons3.php
+++ b/apps/files_external/lib/amazons3.php
@@ -46,6 +46,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
*/
private static $tmpFiles = array();
/**
+ * @var array
+ */
+ private $params;
+ /**
* @var bool
*/
private $test = false;
@@ -101,7 +105,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$this->updateLegacyId($params);
$this->bucket = $params['bucket'];
- $scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https';
$this->test = isset($params['test']);
$this->timeout = (!isset($params['timeout'])) ? 15 : $params['timeout'];
$this->rescanDelay = (!isset($params['rescanDelay'])) ? 10 : $params['rescanDelay'];
@@ -110,7 +113,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
if (!isset($params['port']) || $params['port'] === '') {
$params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443;
}
- $base_url = $scheme . '://' . $params['hostname'] . ':' . $params['port'] . '/';
+ $this->params = $params;
}
/**
@@ -550,11 +553,14 @@ class AmazonS3 extends \OC\Files\Storage\Common {
return $this->connection;
}
+ $scheme = ($this->params['use_ssl'] === 'false') ? 'http' : 'https';
+ $base_url = $scheme . '://' . $this->params['hostname'] . ':' . $this->params['port'] . '/';
+
$this->connection = S3Client::factory(array(
- 'key' => $params['key'],
- 'secret' => $params['secret'],
+ 'key' => $this->params['key'],
+ 'secret' => $this->params['secret'],
'base_url' => $base_url,
- 'region' => $params['region']
+ 'region' => $this->params['region']
));
if (!$this->connection->isValidBucketName($this->bucket)) {