diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-08-27 10:58:17 +0200 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-08-27 10:58:17 +0200 |
commit | 6e8bc13aa3befba15e3df17cb32ef54d447fbfec (patch) | |
tree | 263dab558a503a8cb4b23e754bfc6d23f673bd17 | |
parent | c09cfe4fb92b6b7a521b512526fa5cb5e8324054 (diff) | |
download | nextcloud-server-6e8bc13aa3befba15e3df17cb32ef54d447fbfec.tar.gz nextcloud-server-6e8bc13aa3befba15e3df17cb32ef54d447fbfec.zip |
fix weird logical behaviour
-rw-r--r-- | lib/helper.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/helper.php b/lib/helper.php index dd2476eda5c..cfb29028ee3 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -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; |