Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
sidz wants to merge2 commits intosymfony:4.4fromsidz:do-not-allow-to-denormalize-string-with-spaces
Closed

[Serializer] Do not allow to denormalize string with spaces only to valid a DateTime object#41491

sidz wants to merge2 commits intosymfony:4.4fromsidz:do-not-allow-to-denormalize-string-with-spaces

Conversation

@sidz
Copy link
Contributor

@sidzsidz commentedJun 1, 2021

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsN/A
LicenseMIT

This PR fixes an issue when$data variable contains only spaces. In this case DateTimeNormalizer creates a DateTime object.

maks-rafalko reacted with hooray emoji
@nicolas-grekas
Copy link
Member

Please check tests as they're failing right now.

@sidz
Copy link
ContributorAuthor

sidz commentedJun 3, 2021

@nicolas-grekas done

$timezone =$this->getTimezone($context);

if ('' ===$data ||null===$data) {
if (null ===$data ||(\is_string($data) &&''===trim($data))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Copy link
ContributorAuthor

@sidzsidzJun 3, 2021
edited
Loading

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
Copy link
Member

Thank you@sidz.

nicolas-grekas added a commit that referenced this pull requestJun 4, 2021
…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
Copy link
Member

Looks like something went wrong in the merge process. I'm closing the PR but no worries, the merge did happen3524cf2.

sidz reacted with thumbs up emoji

@chalasrchalasr closed thisJun 4, 2021
@sidzsidz deleted the do-not-allow-to-denormalize-string-with-spaces branchJune 4, 2021 12:50
@fabpotfabpot mentioned this pull requestJun 17, 2021
This was referencedJun 30, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasdunglas approved these changes

@derrabusderrabusderrabus approved these changes

+1 more reviewer

@ro0NLro0NLro0NL approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

7 participants

@sidz@nicolas-grekas@chalasr@dunglas@ro0NL@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp