summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--inc/util.inc.php3
-rw-r--r--modules-available/dnbd3/hooks/main-warning.inc.php2
2 files changed, 4 insertions, 1 deletions
diff --git a/inc/util.inc.php b/inc/util.inc.php
index 1fb5b78e..ace879f4 100644
--- a/inc/util.inc.php
+++ b/inc/util.inc.php
@@ -476,6 +476,9 @@ SADFACE;
*/
public static function prettyTime($ts)
{
+ settype($ts, 'int');
+ if ($ts === 0)
+ return '???';
static $TODAY = false, $ETODAY = false, $YESTERDAY = false, $YEAR = false;
if (!$ETODAY) $ETODAY = strtotime('today 23:59:59');
if ($ts > $ETODAY) // TODO: Do we need strings for future too?
diff --git a/modules-available/dnbd3/hooks/main-warning.inc.php b/modules-available/dnbd3/hooks/main-warning.inc.php
index 258d03d0..e38048e1 100644
--- a/modules-available/dnbd3/hooks/main-warning.inc.php
+++ b/modules-available/dnbd3/hooks/main-warning.inc.php
@@ -8,7 +8,7 @@ if (Dnbd3::isEnabled()) {
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
$error = $row['errormsg'] ? $row['errormsg'] : '<unknown error>';
- $lastSeen = date('d.m.Y H:i', $row['dnbd3lastseen']);
+ $lastSeen = Util::prettyTime($row['dnbd3lastseen']);
if ($row['fixedip'] === '<self>') {
Message::addError('dnbd3.main-dnbd3-unreachable', true, $error, $lastSeen);
continue;