diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-20 00:37:15 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-20 02:19:03 +0100 |
commit | 62d328525a264015ba1f7035aed2e75de69f5cdd (patch) | |
tree | 699ec758b729d45448c04ef11f7a56b9b46cacd9 /apps/files_external | |
parent | b3356b12883b3178a4dce78b258e7ebafd2c7c9a (diff) | |
download | nextcloud-server-62d328525a264015ba1f7035aed2e75de69f5cdd.tar.gz nextcloud-server-62d328525a264015ba1f7035aed2e75de69f5cdd.zip |
setUserVars() should only attempt substitution with strings
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/amazons3.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/config.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/smb_oc.php | 2 | ||||
-rw-r--r-- | apps/files_external/templates/settings.php | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index b956a607eba..40f07b2b22a 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -122,7 +122,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region']; $params['hostname'] = empty($params['hostname']) ? 's3.amazonaws.com' : $params['hostname']; if (!isset($params['port']) || $params['port'] === '') { - $params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443; + $params['port'] = ($params['use_ssl'] === false) ? 80 : 443; } $this->params = $params; } @@ -585,7 +585,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return $this->connection; } - $scheme = ($this->params['use_ssl'] === 'false') ? 'http' : 'https'; + $scheme = ($this->params['use_ssl'] === false) ? 'http' : 'https'; $base_url = $scheme . '://' . $this->params['hostname'] . ':' . $this->params['port'] . '/'; $this->connection = S3Client::factory(array( diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 390f51bfa71..2a523144f7f 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -231,7 +231,9 @@ class OC_Mount_Config { } } } else { - $input = str_replace('$user', $user, $input); + if (is_string($input)) { + $input = str_replace('$user', $user, $input); + } } return $input; } diff --git a/apps/files_external/lib/smb_oc.php b/apps/files_external/lib/smb_oc.php index 52b73c46ff9..547caa5ecbf 100644 --- a/apps/files_external/lib/smb_oc.php +++ b/apps/files_external/lib/smb_oc.php @@ -39,7 +39,7 @@ class SMB_OC extends SMB { public function __construct($params) { if (isset($params['host'])) { $host = $params['host']; - $this->username_as_share = ($params['username_as_share'] === 'true'); + $this->username_as_share = ($params['username_as_share'] === true); // dummy credentials, unused, to satisfy constructor $user = 'foo'; diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 611c5807a5f..5b79edf6cf7 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -27,7 +27,7 @@ <input type="checkbox" <?php if (!empty($classes)): ?> class="<?php p(implode(' ', $classes)); ?>"<?php endif; ?> data-parameter="<?php p($parameter->getName()); ?>" - <?php if ($value == 'true'): ?> checked="checked"<?php endif; ?> + <?php if ($value === true): ?> checked="checked"<?php endif; ?> /> <?php p($placeholder); ?> </label> |