Merge pull request #23606 from nextcloud/bugfix/22913/only-use-index-when-it-exists

Only use index of mount point when it is there
This commit is contained in:
Morris Jobke 2020-10-21 20:43:52 +02:00 committed by GitHub
commit 58d24b7e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -545,7 +545,11 @@ class OC_Helper {
if ($owner) {
$ownerDisplayName = $owner->getDisplayName();
}
[,,,$mountPoint] = explode('/', $mount->getMountPoint(), 4);
if (substr_count($mount->getMountPoint(), '/') < 3) {
$mountPoint = '';
} else {
[,,,$mountPoint] = explode('/', $mount->getMountPoint(), 4);
}
return [
'free' => $free,