-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add request_parse_body() function #11472
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1c328ee
to
9b4e33c
Compare
What happens when you call Also I could see this as ini setting e.g. |
The previous values are overwritten. Uploaded files have another separate storage (
Not sure if you've seen, but https://externals.io/message/120641 contains my full analysis. |
Yes, I've read that. I'll rephrase: I'd add ini setting to be default way to populate Function can be easily called multiple times, which could be hard to realize. INI option wouldn't have these problems, would work exactly like POST and in most cases could be used without problems - in others there would be a function. |
I think INI would be better here as it is more consistent with other setting and flow. I don't really see why function would be better even after reading that analysis. |
A framework couldn't make use of this functionality without the user explicitly enabling this in the config. Furthermore, some hosting scenarios don't allow for ini setting. There's also the possibility of old code parsing the content manually and breaking if this setting is enabled. A function can keep old code working, while making it possible to use it for new code. |
Ok I see some use case for the function but I still think it would be also good to have an ini for this in addition to the function as in most cases it suffices and it would be consistent with the current setup. If I read the current code correctly it looks to me, it resets the vars which I don't think is ideal as in most cases there is no point to reset it. That said there might be some use cases for that so I think there should be an optional parameter in the function to select if it should be overwritten and preferably not overwrite it by default. |
@bukka Thank you. I will consider this.
For the "normal" use-case the array has to be re-initialized because it contains |
9b4e33c
to
d2705c0
Compare
aaa0057
to
71da67e
Compare
f2a8eb4
to
f10e45f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid SAPI interface changes.
@dstogov I avoided the SAPI API changes by backing up and restoring the $_POST and $_FILES globals. The existing API is quite convoluted, but I think it's better to improve this separately, after the RFC has been voted on (either with or without these changes, depending on the voting result). |
Sorry for the noise. Really that API change wasn't a big problem. I thought, it was a change in |
@dstogov It's ok, I think it's better not to change the API too much without a clear strategy on how to improve it in the future. The C changes are now quite straight forward. Since this code doesn't change frequently the need to improve it is not super high. |
7a16b6b
to
25b1841
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just went through this properly and it looks all good to me. Just some few really minor comments but couldn't really find anything else which is good.
This function allows populating the $_POST and $_FILES globals for non-post requests. This avoids manual parsing of RFC1867 requests. Fixes #55815
6f8a145
to
bc13a4b
Compare
This function allows populating the $_POST and $_FILES globals for non-post requests. This avoids manual parsing of RFC1867 requests.
Fixes #55815
https://wiki.php.net/rfc/rfc1867-non-post