From: Barış Metin Date: Wed, 24 Jun 2009 10:53:06 +0000 (+0000) Subject: fix div-by-zero error X-Git-Tag: PLEWWW-4.3-22~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7e6d07762f9e09cf1afd06008785a28293240295;p=plewww.git fix div-by-zero error --- diff --git a/planetlab/includes/plc_objects.php b/planetlab/includes/plc_objects.php index db354bc..a51e2f5 100644 --- a/planetlab/includes/plc_objects.php +++ b/planetlab/includes/plc_objects.php @@ -25,7 +25,7 @@ function timeDiff ($timestamp,$detailed=false,$n = 0) { # Go from decades backwards to seconds $i = sizeof($lengths) - 1; # Size of the lengths / periods in case you change them $time = ""; # The string we will hold our times in - while($i >= $n) { + while($i > $n) { # if the difference is greater than the length we are checking... continue if ($diff > $lengths[$i-1]) { # 65 / 60 = 1. That means one minute. 130 / 60 = 2. Two minutes.. etc