6cc2c293bc
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 #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
```html
<input type="text" name="names[]" value="John" />
<input type="text" name="names[]" value="Doe" />
```
It creates the following raw body:
```
----------------------------466490401959219490193856
Content-Disposition: form-data; name="names[]"
John
----------------------------466490401959219490193856
Content-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-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data
John
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_
Content-Type: text/plain; charset=utf-8; name=1
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name=1
Doe
--_=_symfony_1571410799_b7846b3b4e86d821cdec4379e62b4068_=_--
```
For more complex structures, the $_POST doesn't even recognize properly the field names and values.
Commits
-------
|
||
---|---|---|
.. | ||
Crypto | ||
DependencyInjection | ||
Encoder | ||
Exception | ||
Header | ||
Part | ||
Resources/bin | ||
Test/Constraint | ||
Tests | ||
.gitattributes | ||
.gitignore | ||
Address.php | ||
BodyRendererInterface.php | ||
CHANGELOG.md | ||
CharacterStream.php | ||
composer.json | ||
Email.php | ||
FileBinaryMimeTypeGuesser.php | ||
FileinfoMimeTypeGuesser.php | ||
LICENSE | ||
Message.php | ||
MessageConverter.php | ||
MimeTypeGuesserInterface.php | ||
MimeTypes.php | ||
MimeTypesInterface.php | ||
phpunit.xml.dist | ||
RawMessage.php | ||
README.md |
MIME Component
The MIME component allows manipulating MIME messages.