Skip to content

Commit

Permalink
Fixes incorrect "free" value in stat
Browse files Browse the repository at this point in the history
Signed-off-by: hopleus <[email protected]>
  • Loading branch information
hopleus authored and skjnldsv committed May 30, 2024
1 parent 31b0a44 commit c6a32b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/private/legacy/OC_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoin
$total = $free + $used;
} else {
$total = $free; //either unknown or unlimited

// So that the front does not react to a negative free space value and does not show appropriate warnings
if ($free === \OCP\Files\FileInfo::SPACE_UNKNOWN
|| $free === \OCP\Files\FileInfo::SPACE_UNLIMITED
|| $free === \OCP\Files\FileInfo::SPACE_NOT_COMPUTED) {
$free = PHP_INT_MAX;
}
}
if ($total > 0) {
if ($quota > 0 && $total > $quota) {
Expand Down

0 comments on commit c6a32b6

Please sign in to comment.