Skip to content

Commit f2cd30d

Browse files
authored
Merge pull request #30985 from rotdrop/bugfix/get-storage-info-unjail-shared-path
Use the unjailed-path in OC_Helper::getStorageInfo() for files located in SharedStorage.
2 parents 8d631a0 + a355410 commit f2cd30d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/private/legacy/OC_Helper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,9 @@ public static function getStorageInfo($path, $rootInfo = null) {
506506
if ($storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) {
507507
$includeExtStorage = false;
508508
$sourceStorage = $storage->getSourceStorage();
509+
$internalPath = $storage->getUnjailedPath($rootInfo->getInternalPath());
510+
} else {
511+
$internalPath = $rootInfo->getInternalPath();
509512
}
510513
if ($includeExtStorage) {
511514
if ($storage->instanceOfStorage('\OC\Files\Storage\Home')
@@ -528,7 +531,7 @@ public static function getStorageInfo($path, $rootInfo = null) {
528531
/** @var \OC\Files\Storage\Wrapper\Quota $storage */
529532
$quota = $sourceStorage->getQuota();
530533
}
531-
$free = $sourceStorage->free_space($rootInfo->getInternalPath());
534+
$free = $sourceStorage->free_space($internalPath);
532535
if ($free >= 0) {
533536
$total = $free + $used;
534537
} else {

0 commit comments

Comments
 (0)