Bug #51634 [Asn->Opn]: Can't post multiple fields with the same name
| From: | mike@php.net | Date: | Mon, 22 Aug 2016 12:57:29 +0000 |
| Subject: | Bug #51634 [Asn->Opn]: Can't post multiple fields with the same name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203487@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51634&edit=1
ID: 51634
Updated by: mike@php.net
Reported by: bart at tremby dot net
Summary: Can't post multiple fields with the same name
-Status: Assigned
+Status: Open
Type: Bug
Package: cURL related
Operating System: Ubuntu
PHP Version: 5.2.13
-Assigned To: mike
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2014-04-25 08:56:48] mike@php.net
Related To: Bug #66436
------------------------------------------------------------------------
[2012-05-14 20:21:12] raphael dot droz+floss at gmail dot com
This patch may solve the issue.
I can't see how may I have restricted the new code-path according to the key so I simply tested
for values which are array themselves instead of doing any string lookup/substitution when keys
matches "[]" or anything like that.
I got some problem with the test-suite (can't export PHP_CURL_HTTP_REMOTE_SERVER) anyway I
still had 40 skipped, 2 failures and 33 pass *after* the patch.
If that patch is ok I may add a patch for the test-suite if needed.
NB: please don't bite me, it's my first patch for PHP.
------------------------------------------------------------------------
[2010-04-22 16:01:30] bart at tremby dot net
That works when posting to PHP because of the way PHP handles the names but what it's actually
posting is
name "name[0]", value "val1"
name "name[1]", value "val2"
Any system but PHP as far as I know (I'm posting to a Java-based system and I don't have
control over it) keeps them as they are -- two separate entities called "name[0]" and
"name[1]". There's nothing in the HTTP specification which says anything about array
indices -- as far as I can tell that's purely PHP's invention. PHP which decides
they're the same thing and knocks off the brackets.
The system I'm posting to expects them to be posted with the same name. (The spec says this is
fine -- see <http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.1.2.3>).
The CLI example I gave in the OP does this; the PHP example you just gave does not.
------------------------------------------------------------------------
[2010-04-22 15:53:32] felipe@php.net
You can use: array("name[0]" => "val1", "name[1]" =>
"val2")
------------------------------------------------------------------------
[2010-04-22 15:07:56] bart at tremby dot net
Where I said 'PHP then parses this into an array but only "val2" is in it.' I
meant "Array", not "val2".
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=51634
--
Edit this bug report at https://bugs.php.net/bug.php?id=51634&edit=1