[Pkg-owncloud-commits] [owncloud] 30/78: Fix bugs in ownCloud external storage

David Prévot taffit at moszumanska.debian.org
Sun May 31 01:59:05 UTC 2015


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

taffit pushed a commit to branch master
in repository owncloud.

commit 1c5a86a115e555e3bc1ea133d6911f897bbe7a53
Author: Robin McCorkell <rmccorkell at karoshi.org.uk>
Date:   Tue Feb 24 23:06:47 2015 +0000

    Fix bugs in ownCloud external storage
---
 apps/files_external/lib/owncloud.php            | 4 ++--
 apps/files_external/tests/owncloudfunctions.php | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/apps/files_external/lib/owncloud.php b/apps/files_external/lib/owncloud.php
index 04a1e95..7d452e8 100644
--- a/apps/files_external/lib/owncloud.php
+++ b/apps/files_external/lib/owncloud.php
@@ -37,13 +37,13 @@ class OwnCloud extends \OC\Files\Storage\DAV{
 			$host = substr($host, 0, $hostSlashPos);
 		}
 
-		if (substr($contextPath , 1) !== '/'){
+		if (substr($contextPath, -1) !== '/'){
 			$contextPath .= '/';
 		}
 
 		if (isset($params['root'])){
 			$root = $params['root'];
-			if (substr($root, 1) !== '/'){
+			if (substr($root, 0, 1) !== '/'){
 				$root = '/' . $root;
 			}
 		}
diff --git a/apps/files_external/tests/owncloudfunctions.php b/apps/files_external/tests/owncloudfunctions.php
index 57608ff..deb501a 100644
--- a/apps/files_external/tests/owncloudfunctions.php
+++ b/apps/files_external/tests/owncloudfunctions.php
@@ -68,6 +68,14 @@ class OwnCloudFunctions extends \PHPUnit_Framework_TestCase {
 				),
 				'http://testhost/testroot/remote.php/webdav/subdir/',
 			),
+			array(
+				array(
+					'host' => 'http://testhost/testroot/',
+					'root' => '/subdir',
+					'secure' => false
+				),
+				'http://testhost/testroot/remote.php/webdav/subdir/',
+			),
 		);
 	}
 

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