php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58519 http_request_body_encode
Submitted: 2009-01-26 04:32 UTC Modified: 2009-02-16 10:45 UTC
From: bbaron at bbaron dot sk Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.2.5 OS: linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bbaron at bbaron dot sk
New email:
PHP Version: OS:

 

 [2009-01-26 04:32 UTC] bbaron at bbaron dot sk
Description:
------------
http_request_body_encode - not work with array recursion for $fields


Reproduce code:
---------------
<?
$data = array('user'=>array('name'=>'Bob Smith',
                            'age'=>47,
                            'sex'=>'M',
                            'dob'=>'5/12/1956'),
              'pastimes'=>array('golf', 'opera', 'poker', 'rap'),
              'children'=>array('bobby'=>array('age'=>12,
                                               'sex'=>'M'),
                                'sally'=>array('age'=>8,
                                               'sex'=>'F')),
              'CEO');
echo (http_request_body_encode($data, array(__FILE__)));
?>

Expected result:
----------------
Content-Type: multipart/form-data; boundary=----------------------------6a9046bbcfa7
------------------------------6a9046bbcfa7
Content-Disposition: form-data; name="user[name]"

Bob Smith
------------------------------6a9046bbcfa7
Content-Disposition: form-data; name="user[age]"

47
------------------------------6a9046bbcfa7
Content-Disposition: form-data; name="user[sex]"

M
------------------------------6a9046bbcfa7--
etc

Actual result:
--------------
Content-Type: multipart/form-data; boundary=----------------------------6a9046bbcfa7
------------------------------6a9046bbcfa7
Content-Disposition: form-data; name="user"

Array
------------------------------6a9046bbcfa7
Content-Disposition: form-data; name="pastimes"

Array
------------------------------6a9046bbcfa7
Content-Disposition: form-data; name="children"

Array
------------------------------6a9046bbcfa7--

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-12 11:54 UTC] mike@php.net
Recategorized as feature request.
 [2009-02-16 10:45 UTC] mike@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 15:01:30 2024 UTC