Bug->Req #51634 [Opn]: Can't post multiple fields with the same name

From: Date: Fri, 13 Apr 2018 08:23:07 +0000
Subject: Bug->Req #51634 [Opn]: Can't post multiple fields with the same name
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214726@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:         requinix@php.net
 Reported by:        bart at tremby dot net
 Summary:            Can't post multiple fields with the same name
 Status:             Open
-Type:               Bug
+Type:               Feature/Change Request
 Package:            cURL related
-Operating System:   Ubuntu
+Operating System:   
-PHP Version:        5.2.13
+PHP Version:        7.1
 Block user comment: N
 Private report:     N

 New Comment:

Reviving as a feature request.

I agree that the implementation should not append []s automatically and instead require the
developer to use the right name with the array key. That would allow support for languages like .NET
which use multiple key= pairs.


Previous Comments:
------------------------------------------------------------------------
[2018-04-13 08:20:01] requinix@php.net

Related To: Bug #76216

------------------------------------------------------------------------
[2018-04-13 08:19:31] requinix@php.net

Related To: Bug #67585

------------------------------------------------------------------------
[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.

------------------------------------------------------------------------


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


Thread (12 messages)

« previous php.bugs (#214726) next »