summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/amazons3.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-12-02 16:55:43 +0100
committerVincent Petry <pvince81@owncloud.com>2013-12-03 12:26:08 +0100
commit76b1fcbf27351dee02f45bbf7b6409651ea80b14 (patch)
tree2df1a8a5ae107bacccf96f34bb69f0e50ee654dc /apps/files_external/lib/amazons3.php
parentd6121464a04ad86721e780d125a75d48a5c3fc27 (diff)
downloadnextcloud-server-76b1fcbf27351dee02f45bbf7b6409651ea80b14.tar.gz
nextcloud-server-76b1fcbf27351dee02f45bbf7b6409651ea80b14.zip
Fixed Amazon S3 ext storage config UI
Optional parameters are now really optional Fixes #5861
Diffstat (limited to 'apps/files_external/lib/amazons3.php')
-rw-r--r--apps/files_external/lib/amazons3.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index 9a682fb2d48..b6d02ee0c46 100644
--- a/apps/files_external/lib/amazons3.php
+++ b/apps/files_external/lib/amazons3.php
@@ -81,9 +81,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https';
$this->test = isset($params['test']);
$this->timeout = ( ! isset($params['timeout'])) ? 15 : $params['timeout'];
- $params['region'] = ( ! isset($params['region'])) ? 'eu-west-1' : $params['region'];
- $params['hostname'] = ( !isset($params['hostname'])) ? 's3.amazonaws.com' : $params['hostname'];
- if (!isset($params['port'])) {
+ $params['region'] = ( ! isset($params['region']) || $params['region'] === '' ) ? 'eu-west-1' : $params['region'];
+ $params['hostname'] = ( !isset($params['hostname']) || $params['hostname'] === '' ) ? 's3.amazonaws.com' : $params['hostname'];
+ if (!isset($params['port']) || $params['port'] === '') {
$params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443;
}
$base_url = $scheme.'://'.$params['hostname'].':'.$params['port'].'/';