From c6a32b6abac0ea9f39a4094e5b35dcacc9ce86b7 Mon Sep 17 00:00:00 2001 From: hopleus Date: Mon, 18 Mar 2024 16:29:51 +0300 Subject: [PATCH] Fixes incorrect "free" value in stat Signed-off-by: hopleus --- lib/private/legacy/OC_Helper.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 0c913709111a8..948ed04748169 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -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) {