setUserVars() should only attempt substitution with strings

This commit is contained in:
Robin McCorkell 2015-08-20 00:37:15 +01:00
parent b3356b1288
commit 62d328525a
4 changed files with 7 additions and 5 deletions

View file

@ -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(

View file

@ -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;
}

View file

@ -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';

View file

@ -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>