Skip to content

Commit

Permalink
Merge pull request #30985 from rotdrop/bugfix/get-storage-info-unjail…
Browse files Browse the repository at this point in the history
…-shared-path

Use the unjailed-path in OC_Helper::getStorageInfo() for files located in SharedStorage.
  • Loading branch information
szaimen authored Feb 3, 2022
2 parents 8d631a0 + a355410 commit f2cd30d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/private/legacy/OC_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ public static function getStorageInfo($path, $rootInfo = null) {
if ($storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) {
$includeExtStorage = false;
$sourceStorage = $storage->getSourceStorage();
$internalPath = $storage->getUnjailedPath($rootInfo->getInternalPath());
} else {
$internalPath = $rootInfo->getInternalPath();
}
if ($includeExtStorage) {
if ($storage->instanceOfStorage('\OC\Files\Storage\Home')
Expand All @@ -528,7 +531,7 @@ public static function getStorageInfo($path, $rootInfo = null) {
/** @var \OC\Files\Storage\Wrapper\Quota $storage */
$quota = $sourceStorage->getQuota();
}
$free = $sourceStorage->free_space($rootInfo->getInternalPath());
$free = $sourceStorage->free_space($internalPath);
if ($free >= 0) {
$total = $free + $used;
} else {
Expand Down

0 comments on commit f2cd30d

Please sign in to comment.