From b50e30727fa249706428b25b878a9195b082ee92 Mon Sep 17 00:00:00 2001 From: uvaldenaire-opendsi Date: Wed, 6 Nov 2024 15:56:57 +0100 Subject: [PATCH] fix dol_getdate() when timestamp is an empty string --- htdocs/core/lib/functions.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d87132dc7a595..c3bab3ce70c05 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2980,6 +2980,10 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = */ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') { + if ($timestamp === '') { + return array(); + } + $datetimeobj = new DateTime(); $datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone if ($forcetimezone) {