]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix weird logical behaviour
authorMorris Jobke <morris.jobke@gmail.com>
Tue, 27 Aug 2013 08:58:17 +0000 (10:58 +0200)
committerMorris Jobke <morris.jobke@gmail.com>
Tue, 27 Aug 2013 08:58:17 +0000 (10:58 +0200)
lib/helper.php

index dd2476eda5cf87c6e76c20b71c49421cf0372842..cfb29028ee3e68ef78db2a5276a7260c939f1bd5 100644 (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;