* Filemanager/WebDAV: add (missing) trailing slash in mount URL for WebDAV, as NextCloud requires it

This commit is contained in:
ralf 2022-03-21 10:40:31 +02:00
parent 8acc4c6750
commit 501f0eb1b9

View File

@ -121,7 +121,7 @@ class filemanager_admin extends filemanager_ui
{
$path = @key($content['mounts']['disable']);
}
// set umounted url for a (changed) remount
// set unmounted url for a (changed) remount
$mounts = Vfs::mount();
$content['mounts']['path'] = $path;
$content['mounts']['url'] = Vfs::parse_url($mounts[$path]);
@ -171,6 +171,12 @@ class filemanager_admin extends filemanager_ui
$url .= $content['mounts']['url']['host'] ?: 'default';
$url .= $content['mounts']['url']['path'] ?: $path;
// WebDAV needs a trailing slash and while EGroupware redirects, NextCloud e.g. gives an error
if (preg_match('#^webdavs?://#', $url) && !substr($url, -1) !== '/')
{
$url .= '/';
}
if (($content['mounts']['enable'] || substr($content['mounts']['url']['scheme'], 0, 8) === 'stylite.') && !$this->versioning)
{
throw new Api\Exception\WrongUserinput(lang('Versioning requires EGroupware EPL'));