diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-03-15 16:46:20 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-03-15 16:46:20 +0100 |
commit | 8a97afac6f7ba2e552c01ff3cb0477f5beb8fc92 (patch) | |
tree | 8f5fc1aa852b7a868c54bbbe987614814e2ad496 /lib/helper.php | |
parent | 319e3f162cab32a2bf373b79d401569ca595f168 (diff) | |
download | nextcloud-server-8a97afac6f7ba2e552c01ff3cb0477f5beb8fc92.tar.gz nextcloud-server-8a97afac6f7ba2e552c01ff3cb0477f5beb8fc92.zip |
Don't show storage space warning when the free space can't be determined
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/helper.php b/lib/helper.php index 687f61520a5..73484ad913f 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -812,11 +812,19 @@ class OC_Helper { $used = 0; } $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) { $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); } |