[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.
This commit is contained in:
sysadminstory 2019-03-02 19:10:57 +01:00 committed by LogMANOriginal
parent 9d85b951f7
commit 688c950916

View file

@ -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();
}