Convert: do not block if the $error is a boolean
This commit is contained in:
@@ -60,7 +60,12 @@ class Convert
|
||||
return $inputDate;
|
||||
}
|
||||
$errors = $date->getLastErrors();
|
||||
if ($errors["warning_count"] > 0 || $errors["error_count"] > 0) {
|
||||
if (
|
||||
$errors !== false && (
|
||||
$errors["warning_count"] > 0 ||
|
||||
$errors["error_count"] > 0
|
||||
)
|
||||
) {
|
||||
if ($exception === true) {
|
||||
throw new \Exception(
|
||||
"Invalid date provided or not matching the format",
|
||||
|
||||
Reference in New Issue
Block a user