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

[Mime] Fixing multidimensional array structure with FormDataPart#34032

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

Merged
fabpot merged 1 commit intosymfony:4.4fromjvahldick:fix-multipart-form-data
Nov 30, 2019

Conversation

@jvahldick
Copy link
Contributor

@jvahldickjvahldick commentedOct 18, 2019
edited
Loading

QA
Branch?4.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#33063#34031
LicenseMIT
Doc PR-

The issue is pretty much described on#34031
The current structure of the raw body build on FormDataPart is not well recognized by the server. It considers all the fields as a root type, when actually it is possible to send arrays by html forms.

Lets the following structure on the html

<inputtype="text"name="names[]"value="John"/><inputtype="text"name="names[]"value="Doe"/>

It creates the following raw body:

----------------------------466490401959219490193856Content-Disposition: form-data; name="names[]"John----------------------------466490401959219490193856Content-Disposition: form-data; name="names[]"Doe----------------------------466490401959219490193856--

Meanwhile, the FormDataPart on Mime component generates the following body:

--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_Content-Type: text/plain; charset=utf-8Content-Transfer-Encoding: 8bitContent-Disposition: form-dataJohn--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_Content-Type: text/plain; charset=utf-8; name=1Content-Transfer-Encoding: 8bitContent-Disposition: form-data; name=1Doe--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_--

For more complex structures, the $_POST doesn't even recognize properly the field names and values.

…array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
@nicolas-grekasnicolas-grekas added this to the4.3 milestoneOct 20, 2019
@fabpot
Copy link
Member

Thank you@jvahldick.

jvahldick reacted with thumbs up emojijvahldick reacted with hooray emoji

fabpot added a commit that referenced this pull requestNov 30, 2019
…taPart (jvahldick)This PR was merged into the 4.4 branch.Discussion----------[Mime] Fixing multidimensional array structure with FormDataPart| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#33063#34031| License       | MIT| Doc PR        | -The issue is pretty much described on#34031The current structure of the raw body build on FormDataPart is not well recognized by the server. It considers all the fields as a root type, when actually it is possible to send arrays by html forms.Lets the following structure on the html```html<input type="text" name="names[]" value="John" /><input type="text" name="names[]" value="Doe" />```It creates the following raw body:```----------------------------466490401959219490193856Content-Disposition: form-data; name="names[]"John----------------------------466490401959219490193856Content-Disposition: form-data; name="names[]"Doe----------------------------466490401959219490193856--```Meanwhile, the FormDataPart on Mime component generates the following body:```--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_Content-Type: text/plain; charset=utf-8Content-Transfer-Encoding: 8bitContent-Disposition: form-dataJohn--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_Content-Type: text/plain; charset=utf-8; name=1Content-Transfer-Encoding: 8bitContent-Disposition: form-data; name=1Doe--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_--```For more complex structures, the $_POST doesn't even recognize properly the field names and values.Commits-------ca630e5 Changing the multipart form-data behavior to use the form name as an array, which makes it recognizable as an array by PHP on the $_POST globals once it is coming from the HttpClient component
@fabpotfabpot merged commitca630e5 intosymfony:4.4Nov 30, 2019
This was referencedDec 1, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

4 participants

@jvahldick@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp