From 688c950916d79deb6f400816b9e8f011cf0c5381 Mon Sep 17 00:00:00 2001 From: sysadminstory Date: Sat, 2 Mar 2019 19:10:57 +0100 Subject: [PATCH] [DealabsBridge] Patch unparsable Deal date (#1053) In case of a unparsable date, the text to DateTime object failed, and this resulted to a Fatal error while using this DateTime object . To prvent this fatal error, if the date parsing failse, then a DateTime object is created with the actual date. --- bridges/DealabsBridge.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bridges/DealabsBridge.php b/bridges/DealabsBridge.php index 3427ca65..b64bb1dc 100644 --- a/bridges/DealabsBridge.php +++ b/bridges/DealabsBridge.php @@ -1376,8 +1376,11 @@ class PepperBridgeAbstract extends BridgeAbstract { // Add the Hour and minutes $date_str .= ' 00:00'; - $date = DateTime::createFromFormat('j F Y H:i', $date_str); + // In some case, the date is not recognized : as a workaround the actual date is taken + if($date === false) { + $date = new DateTime(); + } return $date->getTimestamp(); }