summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricewind1991 <robin@icewind.nl>2014-07-23 15:35:55 +0200
committericewind1991 <robin@icewind.nl>2014-07-23 15:35:55 +0200
commite495b4ea194d640721a75902241c02505311e555 (patch)
treebdc76d9fa7d8a73c418003eef2585b283f732242
parent9834e3854201d68fbd5dcbef09122c48cc5bcb10 (diff)
parent97de7bb23e6f26e49c90b9811f6f401f307cdf19 (diff)
downloadnextcloud-server-e495b4ea194d640721a75902241c02505311e555.tar.gz
nextcloud-server-e495b4ea194d640721a75902241c02505311e555.zip
Merge pull request #9789 from owncloud/external-share-root
Fix remote share when remote server is installed at the root
-rw-r--r--apps/files_sharing/lib/external/storage.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 3a0de51192e..855be2872b5 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -49,7 +49,12 @@ class Storage extends DAV implements ISharedStorage {
$this->remote = $options['remote'];
$this->remoteUser = $options['owner'];
list($protocol, $remote) = explode('://', $this->remote);
- list($host, $root) = explode('/', $remote, 2);
+ if (strpos($remote, '/')) {
+ list($host, $root) = explode('/', $remote, 2);
+ } else {
+ $host = $remote;
+ $root = '';
+ }
$secure = $protocol === 'https';
$root = rtrim($root, '/') . '/public.php/webdav';
$this->mountPoint = $options['mountpoint'];
@@ -148,7 +153,7 @@ class Storage extends DAV implements ISharedStorage {
// ownCloud instance is gone, likely to be a temporary server configuration error
throw $e;
}
- } catch(\Exception $shareException) {
+ } catch (\Exception $shareException) {
// todo, maybe handle 403 better and ask the user for a new password
throw $e;
}