Bug #67704 [Opn->Csd]: CURLOPT_POSTFIELDS modify the type of param
| From: | cmb@php.net | Date: | Sat, 10 Mar 2018 23:56:58 +0000 |
| Subject: | Bug #67704 [Opn->Csd]: CURLOPT_POSTFIELDS modify the type of param | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214281@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67704&edit=1
ID: 67704
Updated by: cmb@php.net
Reported by: redfoxli069 at gmail dot com
Summary: CURLOPT_POSTFIELDS modify the type of param
-Status: Open
+Status: Closed
Type: Bug
Package: cURL related
Operating System: Linux
PHP Version: 5.4.31
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Closing, since PHP 5 is out of active support, and the issue has
already been fixed as of PHP 7.0.0.
Previous Comments:
------------------------------------------------------------------------
[2015-08-06 13:30:33] cmb@php.net
I just noticed that there is a respective PR (can't add it via
"Add a Pull Request"): <https://github.com/php/php-src/pull/927>.
------------------------------------------------------------------------
[2015-07-18 15:51:14] cmb@php.net
FWIW, this has been fixed in PHP 7.0
------------------------------------------------------------------------
[2014-12-02 04:51:18] redfoxli069 at gmail dot com
CURLOPT_HTTPHEADER or CURLOPT_QUOTE or CURLOPT_HTTP200ALIASES or CURLOPT_POSTQUOTE or
CURLOPT_PREQUOTE or CURLOPT_TELNETOPTIONS or CURLOPT_MAIL_RCPT or CURLOPT_RESOLVE has the sample
problem, also modify the type of param
Test script:
---------------
$ch = curl_init();
$header = array('a' => 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
var_dump($header['a']);
curl_close($ch);
Expected result:
----------------
int(1)
Actual result:
--------------
string(1) "1"
------------------------------------------------------------------------
[2014-07-29 06:36:15] redfoxli069 at gmail dot com
Description:
------------
CURLOPT_POSTFIELDS modify the type of param
e.gï¼the type of $post_data['a'] from int to string it the "TEST script"
Test script:
---------------
$ch = curl_init();
$post_data = array('a' => 1, 'b' => '2');
if($post_data['a'] === 1)
echo "yes\n";
else
echo "no\n";
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
if($post_data['a'] === 1)
echo "yes\n";
else
echo "no\n";
Expected result:
----------------
yes
yes
Actual result:
--------------
yes
no
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67704&edit=1