From 73f048b96ccc785bb48aa078fb3dda55390e7b7a Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Fri, 5 Feb 2016 22:23:00 +0000 Subject: [PATCH] bug: Timestamp might be invalid --- include/class.misc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/class.misc.php b/include/class.misc.php index 0de812b73..d926200e4 100644 --- a/include/class.misc.php +++ b/include/class.misc.php @@ -92,7 +92,10 @@ class Misc { if (is_int($timestamp)) { $time = $timestamp; } else { - $date = new DateTime($timestamp, $tz); + if (!($date = new DateTime($timestamp, $tz))) { + // Timestamp might be invalid + return $timestamp; + } $time = $date->format('U'); } -- GitLab