Skip to content
Snippets Groups Projects
Commit 8a97afac authored by Robin Appelman's avatar Robin Appelman
Browse files

Don't show storage space warning when the free space can't be determined

parent 319e3f16
No related branches found
No related tags found
No related merge requests found
...@@ -812,11 +812,19 @@ class OC_Helper { ...@@ -812,11 +812,19 @@ class OC_Helper {
$used = 0; $used = 0;
} }
$free = \OC\Files\Filesystem::free_space(); $free = \OC\Files\Filesystem::free_space();
$total = $free + $used; if ($free >= 0){
$total = $free + $used;
} else {
$total = $free; //either unknown or unlimited
}
if ($total == 0) { if ($total == 0) {
$total = 1; // prevent division by zero $total = 1; // prevent division by zero
} }
$relative = round(($used / $total) * 10000) / 100; if ($total >= 0){
$relative = round(($used / $total) * 10000) / 100;
} else {
$relative = 0;
}
return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative); return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment