Bug #75597 [Com]: CURLOPT_POSTFIELDS large string incorrect send
| From: | mb dot php dot net at osps dot net | Date: | Fri, 01 Dec 2017 10:09:16 +0000 |
| Subject: | Bug #75597 [Com]: CURLOPT_POSTFIELDS large string incorrect send | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212856@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75597&edit=1
ID: 75597
Comment by: mb dot php dot net at osps dot net
Reported by: icorrea at cristalmedia dot net
Summary: CURLOPT_POSTFIELDS large string incorrect send
Status: Open
Type: Bug
Package: cURL related
Operating System: Windows
PHP Version: 7.2.0
Block user comment: N
Private report: N
New Comment:
I can confirm the following versions apply:
- problem occurs Windows 32, x64, Thread Safe, 7.1.12
- problem does NOT occur Windows 32, x64, Thread Safe, 7.1.2
Previous Comments:
------------------------------------------------------------------------
[2017-11-30 14:12:14] icorrea at cristalmedia dot net
Description:
------------
---
From manual page: http://www.php.net/function.curl-setopt
---
PHP 7.2.0 and PHP 7.1
When send a large string, for example a base64 encoded image, by POST and set the parameter using
CURLOPT_POSTFIELDS, cURL cut the string and send a repeted string to the original length of the
string.
Example:
$string = array(0 => "ABCDEFGHIJKLMN.."); // test with a string > 20000 length
..
curl_setopt($s, CURLOPT_POST, true);
curl_setopt($s, CURLOPT_POSTFIELDS, $string );
...
then on other side the server recive:
"ABCDEFABCDEFABCD.."
cuting the string in 16K size and repeated any times to complete the original size.
Test the same code with PHP5 and this bug is not present.
Test script:
---------------
$string = array(0 => "ABCDEFGHIJKLMN.."); // test with a string > 20000 length
..
curl_setopt($s, CURLOPT_POST, true);
curl_setopt($s, CURLOPT_POSTFIELDS, $string );
...
then on other side the server recive:
"ABCDEFABCDEFABCD.."
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75597&edit=1