From fb2e997c9212f00ae977259465a06e9cc5947abb Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 21 Jun 2016 01:33:57 +0100 Subject: Avoid crazy durations when start is 0 --- index.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index b7162f9..1bf8329 100644 --- a/index.php +++ b/index.php @@ -180,11 +180,13 @@ if ($total > 0) { $show_time = ''; if ($p['type'] == 'uploaded') { - $tdiff = timediff($p['buildtime']['start'], $p['buildtime']['end']); // use $p['buildtime']['diff']; instead? - $show_time = '' . $tdiff . ''; + if ($p['buildtime']['start'] && $p['buildtime']['end']) { + $tdiff = timediff($p['buildtime']['start'], $p['buildtime']['end']); // use $p['buildtime']['diff']; instead? + $show_time = '' . $tdiff . ''; - $tdiff = floor(($p['buildtime']['end'] - $p['buildtime']['start']) / 60)*60; - @$buildtime_stats[timediff(0, $tdiff)] += 1; + $tdiff = floor(($p['buildtime']['end'] - $p['buildtime']['start']) / 60)*60; + @$buildtime_stats[timediff(0, $tdiff)] += 1; + } } $s .= ($typelink != '') ? sprintf(' %s %s', -- cgit v1.2.1