summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-04 18:25:09 +0100
committerSimon Rettberg2017-12-04 18:25:09 +0100
commit5f1abf31f333ce1e70af85cc85681468664d2d75 (patch)
tree81d58ee0319990431bef96d2362b1e4a5da2f102 /inc
parentUpdate translations (diff)
downloadslx-admin-5f1abf31f333ce1e70af85cc85681468664d2d75.tar.gz
slx-admin-5f1abf31f333ce1e70af85cc85681468664d2d75.tar.xz
slx-admin-5f1abf31f333ce1e70af85cc85681468664d2d75.zip
[inc/Util] prettyTime: return '???' if given timestamp is 0 or not a number
Diffstat (limited to 'inc')
-rw-r--r--inc/util.inc.php3
1 files changed, 3 insertions, 0 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?