Merge pull request #9789 from owncloud/external-share-root

Fix remote share when remote server is installed at the root
This commit is contained in:
icewind1991 2014-07-23 15:35:55 +02:00
commit e495b4ea19
1 changed files with 7 additions and 2 deletions

View File

@ -49,7 +49,12 @@ class Storage extends DAV implements ISharedStorage {
$this->remote = $options['remote']; $this->remote = $options['remote'];
$this->remoteUser = $options['owner']; $this->remoteUser = $options['owner'];
list($protocol, $remote) = explode('://', $this->remote); 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'; $secure = $protocol === 'https';
$root = rtrim($root, '/') . '/public.php/webdav'; $root = rtrim($root, '/') . '/public.php/webdav';
$this->mountPoint = $options['mountpoint']; $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 // ownCloud instance is gone, likely to be a temporary server configuration error
throw $e; throw $e;
} }
} catch(\Exception $shareException) { } catch (\Exception $shareException) {
// todo, maybe handle 403 better and ask the user for a new password // todo, maybe handle 403 better and ask the user for a new password
throw $e; throw $e;
} }