Closed
Description
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 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:
new FormDataPart([
'1' => [
'a' => 'one',
'b' => 'two',
],
]);
How to reproduce
Create a form containing
```html
<input type="hidden" name="bar[0][foo]" value="v1">
will resolve as bar[foo]
.
Then create improve the form as...
<input type="hidden" name="bar[0][foo]" value="v1">
<input type="hidden" name="bar[0][baz]" value="v2">
will throw an exception.
Use the HttpBrowser to post the forms.
Possible Solution
- Fix to the the field naming bug.
- Remove the limitation
- Keep the current feature introduced in [Mime] Allow multiple parts with the same name in FormDataPart #38323