Re: [RFC] Add parse_query_string as an alternative toparse_str
| From: | Christoph M. Becker | Date: | Fri, 06 Aug 2021 15:38:47 +0000 |
| Subject: | Re: [RFC] Add parse_query_string as an alternative toparse_str | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115646@lists.php.net to get a copy of this message | ||
On 06.08.2021 at 15:20, Rowan Tommins wrote:
> On 06/08/2021 12:12, Kamil Tekiela wrote:
>
>> 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
>
> Changing behaviour like this is tricky, because even if it's not that
> useful, it is consistent, so code to process a query string of
> "?foo.bar=42" will be looking at $_GET['foo_bar'] not
> $_GET['foo.bar']..
> If we "fix" the name mangling, that code will break, and not necessarily
> in a very obvious way.
>
> Note that there are other parts of the request which get mangled in
> similar ways, such as when HTTP headers are translated into CGI
> environment variables. The solution in that case is to ignore the CGI
> vars and use a function like getallheaders(), so having a non-mangling
> http_parse_query() doesn't feel out of place.
Right. *If* we want to change this name mangling, we should change it
everywhere, and that certainly needs an own RFC and ideally some kind of
deprecation/change notice.
--
Christoph M. Becker