Ref T13008. Before we can disable enable_post_data_reading, we must be able to rebuild $_FILES ourselves. Before we can do this, we must be able to parse multipart/form-data requests. And, before we can do this, we must be able to parse complex HTTP headers, including these:
Content-Type: multipart/form-data; boundary="ABCDEFG"
Content-Disposition: form-data; name="something"; filename="something else"
Add a parser which can do this. The key parts are:
- Picking the "boundary" out of the "Content-Type" header.
- Picking all the stuff out of the "Content-Disposition" header for the actual multipart body.
This parser probably isn't perfect, but it will only be invoked when users upload vanilla files (e.g., "Change Profile Picture") so it's okay if it takes a while to sort out all the details.