Bug #75597 [Opn->Fbk]: CURLOPT_POSTFIELDS large string incorrect send

From: Date: Fri, 12 Jan 2018 16:28:10 +0000
Subject: Bug #75597 [Opn->Fbk]: CURLOPT_POSTFIELDS large string incorrect send
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213496@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
 Updated by:         ab@php.net
 Reported by:        icorrea at cristalmedia dot net
 Summary:            CURLOPT_POSTFIELDS large string incorrect send
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            cURL related
 Operating System:   Windows
 PHP Version:        7.2.0
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for the report. Please check the latest snapshot. Likely bug #75764 is also related.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2018-01-08 09:57:23] c dot bermon at eona dot com

Agree with Peter, CURL must be updated. Bug present from PHP 7.1.11

------------------------------------------------------------------------
[2017-12-13 08:56:43] peter at grootplezier dot nl

This problem is fixed in version 7.56.1 - October 23 2017. Can this be included in the next version
please.

------------------------------------------------------------------------
[2017-12-01 10:09:14] mb dot php dot net at osps dot net

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

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


Thread (7 messages)

« previous php.bugs (#213496) next »