[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:
parent
9d85b951f7
commit
688c950916
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue