Edit report at https://bugs.php.net/bug.php?id=55767&edit=1

 ID:                 55767
 Comment by:         brad at hostland dot com
 Reported by:        brad at hostland dot com
 Summary:            CURLOPT_POSTFIELDS Ignores Numeric Field Names
 Status:             Closed
 Type:               Bug
 Package:            cURL related
 Operating System:   Linux
 PHP Version:        5.3.8
 Assigned To:        rasmus
 Block user comment: N
 Private report:     N

 New Comment:

Is there any way this can be fixed in 5.3? This is causing me big problems and 
I'm unable to install 5.4 at this time.


Previous Comments:
------------------------------------------------------------------------
[2011-09-23 13:21:42] ras...@php.net

Fixed in 5.4 and trunk. Need to have a closer look to see if it might be a BC 
break in 5.3

------------------------------------------------------------------------
[2011-09-23 13:16:18] ras...@php.net

Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=317201
Log: Fix for bug #55767

------------------------------------------------------------------------
[2011-09-23 07:41:34] brad at hostland dot com

Description:
------------
If you use a numeric array key to represent a numeric field name, cURL will 
ignore the field completely when submitting the POST.

For example, suppose you have an HTML form containing a field named 'somefield' 
and another field named '100'. We want to simulate submitting this form using 
cURL:

When the script below is executed, cURL will submit the form and pass the 
'somefield' data, but will completely ignore the '100' data in the form post.

$ch = curl_init('http://www.someurl.com');
curl_setopt($ch, CURLOPT_POST, 1);
$fields['somefield'] = 'Some Data';
$fields['100'] = 'Some Other Data';
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$output = curl_exec($ch);

Test script:
---------------
$ch = curl_init('http://www.someurl.com');
curl_setopt($ch, CURLOPT_POST, 1);
$fields['somefield'] = 'Some Data';
$fields['100'] = 'Some Other Data';
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$output = curl_exec($ch);



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



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55767&edit=1

Reply via email to