-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DateTime parsed invalid date #1152
Comments
This is not a bug but the normal PHP'd DateTime behavior. See https://3v4l.org/pHq23 if you need to validate your incoming data, you should use the preDeserialize event. |
if ((\DateTime::getLastErrors()['warning_count'] ?? 0) > 0) {
throw new RuntimeException(sprintf('The parsed date "%s" was invalid', $data));
} This sounds a good thing but would result in a BC break. I can accept this new behavior only if the PR allows to opt-in for this stricter validation. (maybe passing some parameter in the constructor? |
Hi @goetas. btw, PR should be on 4.0 version, right ? |
If we make the __construct(
string $defaultFormat = \DateTime::ATOM,
string $defaultTimezone = 'UTC',
bool $xmlCData = true
string $dateTimeParsing = 'lax', // or 'strict'
) and then we use |
Hi. Sorry for unactivity. I saw a 3.6 release but I can't found a changes in code. |
which changes? |
it seems that the tool i use to generate the changelog messed up, this ticket was closed by you, so no changes have been implemented on my end. |
As said in #1152 (comment), i'm happy to accept a PR implementing something as suggested there. |
I understand. I closed this issue because I thought I couldn't add this option on PR cause is related to bundle too. |
Steps required to reproduce the problem
Expected Result
Actual Result
Solution
In DataHandler after:
should be next check about last errors:
The text was updated successfully, but these errors were encountered: