Only use index of mount point when it is there

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-10-21 13:37:56 +02:00 committed by Morris Jobke
parent 1655400183
commit e29eb55f8b
No known key found for this signature in database
GPG key ID: FE03C3A163FEDE68

View file

@ -544,7 +544,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,