Re: [RFC] Add parse_query_string as an alternative to parse_str
| From: | Kamil Tekiela | Date: | Fri, 06 Aug 2021 11:12:58 +0000 |
| Subject: | Re: [RFC] Add parse_query_string as an alternative to parse_str | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115641@lists.php.net to get a copy of this message | ||
btw why isn't foo.bar=123 decoded to array("foo.bar"=>123); ?
> this looks pretty bad to me https://3v4l.org/6Wa23
Hi Hans,
This is because variables in PHP that contain the concatenation operator or
space are much more difficult to access. See https://3v4l.org/vUBWK
As the primary purpose of parse_str was to register globals from a query
string, it follows the same logic as your normal POST/GET/COOKIE parsing.
See https://stackoverflow.com/a/68742/1839439
Perhaps, instead of adjusting this behaviour only for the new function, we
could remove this behaviour as a whole, given that it is a remainder of the
long-forgotten register globals? I don't see any use for it anymore, as all
parsed input is only available in the form of an associative array. People
who extract $_POST can suffer the consequences of their own actions...
Regards,
Kamil