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:21:45 +0100 |
commit | d6bc77599eb1b2a78584e7ce1b0af7670ba96c40 (patch) | |
tree | 6c07505c45273793ee0a0655947038762b0dca5c | |
parent | 21c9dd284b474693d35281316ec25bf1617d65c8 (diff) | |
download | nextcloud-server-d6bc77599eb1b2a78584e7ce1b0af7670ba96c40.tar.gz nextcloud-server-d6bc77599eb1b2a78584e7ce1b0af7670ba96c40.zip |
setUserVars() should only attempt substitution with strings
-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 02a02710a14..cff796c6230 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -121,7 +121,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; } @@ -586,7 +586,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 40e9a75790f..03a3b8479c1 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -297,7 +297,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 b886c2e1b1b..1cdaa3c4ae8 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -60,7 +60,7 @@ <?php elseif (strpos($placeholder, '!') === 0): ?> <label><input type="checkbox" data-parameter="<?php p($parameter); ?>" - <?php if ($value == 'true'): ?> checked="checked"<?php endif; ?> + <?php if ($value === true): ?> checked="checked"<?php endif; ?> /><?php p(substr($placeholder, 1)); ?></label> <?php elseif (strpos($placeholder, '#') === 0): ?> <input type="hidden" |