From 2b2df1eca0438069c5307ec6ec551613512f9732 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Tue, 12 May 2015 16:19:37 -0500 Subject: [PATCH] oops: Fix date format crash if `intl` extension missing --- include/class.format.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/class.format.php b/include/class.format.php index b184b26cf..cd9b27f24 100644 --- a/include/class.format.php +++ b/include/class.format.php @@ -441,9 +441,12 @@ class Format { $strftimeFallback, $timezone, $user=false) { global $cfg; - if ($timestamp && $fromDb) { + if (!$timestamp) + return ''; + + if ($fromDb) $timestamp = Misc::db2gmtime($timestamp); - } + if (class_exists('IntlDateFormatter')) { $formatter = new IntlDateFormatter( Internationalization::getCurrentLocale($user), -- GitLab