Skip to content
Snippets Groups Projects
Commit 73f048b9 authored by Peter Rotich's avatar Peter Rotich
Browse files

bug: Timestamp might be invalid

parent 98168358
No related branches found
No related tags found
No related merge requests found
...@@ -92,7 +92,10 @@ class Misc { ...@@ -92,7 +92,10 @@ class Misc {
if (is_int($timestamp)) { if (is_int($timestamp)) {
$time = $timestamp; $time = $timestamp;
} else { } else {
$date = new DateTime($timestamp, $tz); if (!($date = new DateTime($timestamp, $tz))) {
// Timestamp might be invalid
return $timestamp;
}
$time = $date->format('U'); $time = $date->format('U');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment