|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43222 stream_context_create() bugs
Submitted: 2007-11-09 03:32 UTC Modified: 2008-11-03 01:00 UTC
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lihonggang at 100 dot cn Assigned:
Status: No Feedback Package: URL related
PHP Version: 5.2CVS-2007-11-09 (CVS) OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-11-09 03:32 UTC] lihonggang at 100 dot cn
stream_context_create  post content bug.
sometime the post data is excessive four bytes than 'content'

Reproduce code:
function micat_post($url,$content) {

	$content_length = strlen($content);
	$options = array(
	'method' => 'POST',
	'header' =>"Content-type:                application/x-www-form-urlencoded\r\n" . 
	"Content-length: $content_length\r\n".
	"Command-length: $content_length\r\n",
	'content' => $content
	$context = stream_context_create($options);
	$response = file_get_contents($url, false, $context);

Expected result:
the send data should be "a=b&c=d" but by using snort ,i found the send data is ""a=b&c=d\r\n\r\n"

Actual result:
more foue bytes than content


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-26 23:45 UTC]
Please try using this CVS snapshot:
For Windows:

 [2008-11-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 00:03:57 2022 UTC