Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Serializer] Do not allow to denormalize string with spaces only to valid a DateTime object#41491
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Tests/Normalizer/DateTimeNormalizerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedJun 3, 2021
Please check tests as they're failing right now. |
sidz commentedJun 3, 2021
@nicolas-grekas done |
| $timezone =$this->getTimezone($context); | ||
| if ('' ===$data ||null===$data) { | ||
| if (null ===$data ||(\is_string($data) &&''===trim($data))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
well this change a lot but exception message says:
The data is either an emptystring ornull, you should pass astring that can be parsed with the passed format or a valid DateTimestring.
nicolas-grekas commentedJun 4, 2021
Thank you@sidz. |
…s only to valid a DateTime object (sidz)This PR was squashed before being merged into the 4.4 branch.Discussion----------[Serializer] Do not allow to denormalize string with spaces only to valid a DateTime object| Q | A| ------------- | ---| Branch? |4.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | N/A| License | MITThis PR fixes an issue when `$data` variable contains only spaces. In this case DateTimeNormalizer creates a DateTime object.Commits-------21c0829 [Serializer] Do not allow to denormalize string with spaces only to valid a DateTime object
chalasr commentedJun 4, 2021
Looks like something went wrong in the merge process. I'm closing the PR but no worries, the merge did happen3524cf2. |
This PR fixes an issue when
$datavariable contains only spaces. In this case DateTimeNormalizer creates a DateTime object.