Bug #75597 [NEW]: CURLOPT_POSTFIELDS large string incorrect send
| From: | icorrea at cristalmedia dot net | Date: | Thu, 30 Nov 2017 14:12:16 +0000 |
| Subject: | Bug #75597 [NEW]: CURLOPT_POSTFIELDS large string incorrect send | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-212834@lists.php.net to get a copy of this message | ||
From: icorrea at cristalmedia dot net
Operating system: Windows
PHP version: 7.2.0
Package: cURL related
Bug Type: Bug
Bug description:CURLOPT_POSTFIELDS large string incorrect send
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 bug report at https://bugs.php.net/bug.php?id=75597&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75597&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75597&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75597&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75597&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75597&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75597&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75597&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75597&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75597&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75597&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75597&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75597&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75597&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75597&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75597&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75597&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75597&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75597&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75597&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75597&r=mysqlcfg