summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2015-02-25 10:39:25 +0000
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2015-02-25 10:39:25 +0000
commitaf96078153f385fd8a9f7f7e2b295aa01f8b0973 (patch)
tree66f389c2f20dce38218785779fd5ccadda0eabfe /apps
parent7f7cdecb1a070e1c691a343abe2be2cad0937a1e (diff)
parentedfeb05a05284549b3d6df574bf0dcc1c4adec1c (diff)
downloadnextcloud-server-af96078153f385fd8a9f7f7e2b295aa01f8b0973.tar.gz
nextcloud-server-af96078153f385fd8a9f7f7e2b295aa01f8b0973.zip
Merge pull request #14475 from owncloud/fix-ext-owncloud
Fix bugs in ownCloud external storage
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/owncloud.php4
-rw-r--r--apps/files_external/tests/owncloudfunctions.php8
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_external/lib/owncloud.php b/apps/files_external/lib/owncloud.php
index e9824140c7a..d00da691cd9 100644
--- a/apps/files_external/lib/owncloud.php
+++ b/apps/files_external/lib/owncloud.php
@@ -49,13 +49,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 de7bf3eff2b..0135c4618a3 100644
--- a/apps/files_external/tests/owncloudfunctions.php
+++ b/apps/files_external/tests/owncloudfunctions.php
@@ -81,6 +81,14 @@ class OwnCloudFunctions extends \Test\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/',
+ ),
);
}