diff options
author | Pascal Terjan <pterjan@gmail.com> | 2016-06-21 01:33:57 +0100 |
---|---|---|
committer | Pascal Terjan <pterjan@gmail.com> | 2016-06-21 01:33:57 +0100 |
commit | fb2e997c9212f00ae977259465a06e9cc5947abb (patch) | |
tree | 49826522c5b493eb3e281eb348ce849b88f04cd2 | |
parent | 3e1ae893bb747ce1881c240fc30c278eff607d59 (diff) | |
download | pkgsubmit-fb2e997c9212f00ae977259465a06e9cc5947abb.tar pkgsubmit-fb2e997c9212f00ae977259465a06e9cc5947abb.tar.gz pkgsubmit-fb2e997c9212f00ae977259465a06e9cc5947abb.tar.bz2 pkgsubmit-fb2e997c9212f00ae977259465a06e9cc5947abb.tar.xz pkgsubmit-fb2e997c9212f00ae977259465a06e9cc5947abb.zip |
Avoid crazy durations when start is 0
-rw-r--r-- | index.php | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 = '<span class="timeinfo">' . $tdiff . '</span>'; + if ($p['buildtime']['start'] && $p['buildtime']['end']) { + $tdiff = timediff($p['buildtime']['start'], $p['buildtime']['end']); // use $p['buildtime']['diff']; instead? + $show_time = '<span class="timeinfo">' . $tdiff . '</span>'; - $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('<a rel="nofollow" href="%s" class="status-link"><span class="status-box"></span> %s %s</a>', |