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

[HttpFoundation] fixed Request::getContent() reusage bug#19549

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
1ma wants to merge3 commits intosymfony:2.7from1ma:getcontent-fix
Closed

[HttpFoundation] fixed Request::getContent() reusage bug#19549

1ma wants to merge3 commits intosymfony:2.7from1ma:getcontent-fix

Conversation

@1ma
Copy link
Contributor

@1ma1ma commentedAug 5, 2016

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

After callingRequest::getContent(true), subsequent calls to the
same instance method (withouth the$asResource flag) always returned
false instead of the request body as a plain string.

A unit test already existed to guard against this behaviour (the 'Resource then fetch' case) but it
yielded a false positive because it was comparing'' tofalse using
PHPUnit'sassertEquals method instead ofassertSame.

For completeness sake I also added the missing usage permutations in
the data provider, which already worked OK.

After calling Request::getContent(true), subsequent calls to thesame instance method (withouth the $asResource flag) always returnedfalse instead of the request body as a plain string.A unit test already existed to guard against this behaviour but ityielded a false positive because it was comparing '' to false usingPHPUnit's assertEquals() instead of assertSame().For completeness sake I also added the missing usage permutations inthe test data provider.
@1ma1ma changed the title[HttpFoundation] fixed testGetContentCanBeCalledTwiceWithResources scenario[HttpFoundation] fixed Request::getContent() reusage bugAug 5, 2016
@fabpot
Copy link
Member

Thank you@1ma.

fabpot added a commit that referenced this pull requestAug 15, 2016
…1ma)This PR was squashed before being merged into the 2.7 branch (closes#19549).Discussion----------[HttpFoundation] fixed Request::getContent() reusage bug| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |After calling ```Request::getContent(true)```, subsequent calls to thesame instance method (withouth the ```$asResource``` flag) always returned```false``` instead of the request body as a plain string.A unit test already existed to guard against this behaviour (the 'Resource then fetch' case) but ityielded a false positive because it was comparing ```''``` to ```false``` usingPHPUnit's ```assertEquals``` method instead of ```assertSame```.For completeness sake I also added the missing usage permutations inthe data provider, which already worked OK.Commits-------c42ac66 [HttpFoundation] fixed Request::getContent() reusage bug
@fabpotfabpot closed thisAug 15, 2016
@1ma1ma deleted the getcontent-fix branchAugust 16, 2016 15:29
This was referencedSep 2, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@1ma@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp