Form : do not use an error array if there is no error and the array is false

This commit is contained in:
2023-06-23 07:35:16 +02:00
parent 46979352b8
commit d86b69ce61

View File

@@ -613,7 +613,7 @@ class Form
return $inputDate;
}
$errors = $date->getLastErrors();
if ($errors["warning_count"] > 0 || $errors["error_count"] > 0) {
if (is_array($errors) && ($errors["warning_count"] > 0 || $errors["error_count"] > 0)) {
return $inputDate;
}
return $date->format($outputFormat);