Skip to content

Commit

Permalink
Merge pull request #31136 from nextcloud/backport/30985/stable22
Browse files Browse the repository at this point in the history
[stable22] Use the unjailed-path in OC_Helper::getStorageInfo() for files located in SharedStorage.
  • Loading branch information
szaimen authored Feb 21, 2022
2 parents 72f7ccf + c31adf1 commit 55ce97c
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 55ce97c

Please sign in to comment.