From 5f1abf31f333ce1e70af85cc85681468664d2d75 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 4 Dec 2017 18:25:09 +0100 Subject: [inc/Util] prettyTime: return '???' if given timestamp is 0 or not a number --- inc/util.inc.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc') 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? -- cgit v1.2.3-55-g7522