From a6a6c323c77d2467ff7396838ab18cd549ea7776 Mon Sep 17 00:00:00 2001 From: Bartek Date: Wed, 14 Oct 2020 09:31:24 +0200 Subject: [PATCH] EZP-32018: Added additional validation to ezdate fieldtype (#1465) --- lib/ezutils/classes/eztimestamp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ezutils/classes/eztimestamp.php b/lib/ezutils/classes/eztimestamp.php index 181d58f4644..6e952f05ffb 100644 --- a/lib/ezutils/classes/eztimestamp.php +++ b/lib/ezutils/classes/eztimestamp.php @@ -15,7 +15,7 @@ class eZTimestamp */ public static function getUtcTimestampFromLocalTimestamp( $localTimestamp ) { - if ( !$localTimestamp ) + if ( $localTimestamp === null || $localTimestamp === '' ) { return null; } @@ -35,7 +35,7 @@ public static function getUtcTimestampFromLocalTimestamp( $localTimestamp ) { */ public static function getLocalTimestampFromUtcTimestamp( $utcTimestamp ) { - if ( !$utcTimestamp ) + if ( $utcTimestamp === null || $utcTimestamp === '' ) { return null; }