Merge pull request #4592 from owncloud/fix-logic

fix weird logical behaviour
This commit is contained in:
Thomas Müller 2013-08-29 08:40:33 -07:00
commit 0104d3df96
1 changed files with 2 additions and 4 deletions

View File

@ -858,10 +858,8 @@ class OC_Helper {
} else {
$total = $free; //either unknown or unlimited
}
if ($total == 0) {
$total = 1; // prevent division by zero
}
if ($total >= 0) {
if ($total > 0) {
// prevent division by zero or error codes (negative values)
$relative = round(($used / $total) * 10000) / 100;
} else {
$relative = 0;