|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-18 22:39 UTC] sibaz at sibaz dot com
[2003-08-19 03:13 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 09:00:02 2025 UTC |
Description: ------------ Understandably parse_str mangles CGI field names to fit into the PHP variable name space. When given a second array parameter the mangled variable names are used as indexes in the array, as documented. However the more intuitive implementation would be for the array index to be the actual unmangled CGI field name specified. It makes more sense to me, to not mangle variable names, when populating an array. Clearly a change of existing behaviour would be damaging, so perhaps a config or ini setting could be used to turn off name mangling for array indexes, or perhaps a third optional parameter to the function could dictate whether or not to mangle the names. The primary need for this is to avoid mangling when using fieldnames that are sqlfield names. These may contain dots if the field name is fully qualified to include the table name it is dotted. It seems a waste to have to invent a separate mangling process for phpfield name (hiding sqlfield name) just because of unneeded, unpreventable mangling within php. IMHO $_GET should be an array of unmangled CGI Field names. Reproduce code: --------------- $array=array(); parse_str("this.that=1", $array); echo serialize($array)."<br>\n"; // prints a:1:{s:9:"this_that";s:1:"1";} Expected result: ---------------- // ideally it should print a:1:{s:9:"this.that";s:1:"1";} Actual result: -------------- // it currently prints a:1:{s:9:"this_that";s:1:"1";}