[Pkg-owncloud-commits] [owncloud] 56/79: setUserVars() should only attempt substitution with strings

David Prévot taffit at moszumanska.debian.org
Tue Sep 1 20:55:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit d6bc77599eb1b2a78584e7ce1b0af7670ba96c40
Author: Robin McCorkell <rmccorkell at owncloud.com>
Date:   Thu Aug 20 00:37:15 2015 +0100

    setUserVars() should only attempt substitution with strings
---
 apps/files_external/lib/amazons3.php       | 4 ++--
 apps/files_external/lib/config.php         | 4 +++-
 apps/files_external/lib/smb_oc.php         | 2 +-
 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 02a0271..cff796c 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 40e9a75..03a3b84 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 52b73c4..547caa5 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 b886c2e..1cdaa3c 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"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list