Skip to content
Snippets Groups Projects
Commit 0104d3df authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #4592 from owncloud/fix-logic

fix weird logical behaviour
parents 2cfcf008 6e8bc13a
No related branches found
No related tags found
No related merge requests found
...@@ -858,10 +858,8 @@ class OC_Helper { ...@@ -858,10 +858,8 @@ class OC_Helper {
} else { } else {
$total = $free; //either unknown or unlimited $total = $free; //either unknown or unlimited
} }
if ($total == 0) { if ($total > 0) {
$total = 1; // prevent division by zero // prevent division by zero or error codes (negative values)
}
if ($total >= 0) {
$relative = round(($used / $total) * 10000) / 100; $relative = round(($used / $total) * 10000) / 100;
} else { } else {
$relative = 0; $relative = 0;
......
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