You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#38323 introduced the possibility to have multiple parts with the same name. However, this PR added some issues: A from element, such as <input type="hidden" name="bar[0][foo]"> is resolved as bar[foo]. But that is wrong, bar[0][foo] is correct. Also it introduced a limitation in the sense if the field name is actually meant to be an integer, eg the following currently is throwing an exception:
claudiu-cristea
changed the title
[Mime] Form field values with integer keys can only have one array element
[Mime] Form field values with integer keys not resolved correctly
Sep 7, 2022
…rrectly (claudiu-cristea)
This PR was squashed before being merged into the 5.4 branch.
Discussion
----------
[Mime] Form field values with integer keys not resolved correctly
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#47504
| License | MIT
| Doc PR |
This should be legit:
```
new FormDataPart([
'qux' => [
[
'foo' => 'v1',
'baz' => 'v2',
],
[
'foo' => 'v3',
'baz' => 'v4',
],
],
]);
```
Fixes#47504
Commits
-------
923de03 [Mime] Form field values with integer keys not resolved correctly
Symfony version(s) affected
5.4, 6.2
Description
#38323 introduced the possibility to have multiple parts with the same name. However, this PR added some issues: A from element, such as
<input type="hidden" name="bar[0][foo]">
is resolved asbar[foo]
. But that is wrong,bar[0][foo]
is correct. Also it introduced a limitation in the sense if the field name is actually meant to be an integer, eg the following currently is throwing an exception:How to reproduce
Create a form containing
will resolve as
bar[foo]
.Then create improve the form as...
will throw an exception.
Use the HttpBrowser to post the forms.
Possible Solution
The text was updated successfully, but these errors were encountered: