note 75954 added to function.http-parse-params
| From: | SiegfriedGevatterrainct at ubuntuwire dot com | Date: | Sat, 23 Jun 2007 17:55:05 +0000 |
| Subject: | note 75954 added to function.http-parse-params | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127903@lists.php.net to get a copy of this message | ||
I found a little problem on the function I previously posted here, getParser(): PHP replacing all
dots in the key with _'s, so following change would be needed to be done in the function:
Replace:
<?PHP
$gets[$name] = $value;
?>
With:
<?PHP
$gets[str_replace('.', '_', $name)] = urldecode($value);
?>
But actually, arpad (on ##php @ irc.freenode.net) let me notice that it's so, but not if
something is between [ and ], so ?var.one[var.two]=hi would become
$_GET['var_one[var.two]']. Because of this, as he said, following line should go there
instead:
<?PHP
$gets[preg_replace("/\.(?=[^\]]*(?:\[|\z))/", '_', $name)] =
urldecode($value);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 62.87.103.212
----
Manual Page -- http://www.php.net/manual/en/function.http-parse-params.php
Edit -- https://master.php.net/note/edit/75954
Del: integrated -- https://master.php.net/note/delete/75954/integrated
Del: useless -- https://master.php.net/note/delete/75954/useless
Del: bad code -- https://master.php.net/note/delete/75954/bad+code
Del: spam -- https://master.php.net/note/delete/75954/spam
Del: non-english -- https://master.php.net/note/delete/75954/non-english
Del: in docs -- https://master.php.net/note/delete/75954/in+docs
Del: other reasons-- https://master.php.net/note/delete/75954
Reject -- https://master.php.net/note/reject/75954
Search -- https://master.php.net/manage/user-notes.php