php.net |  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
Votes:2
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
 [2007-11-09 03:32 UTC] lihonggang at 100 dot cn
Description:
------------
stream_context_create  post content bug.
sometime the post data is excessive four bytes than 'content'

Reproduce code:
---------------
$url="http://192.168.0.110:6633/1.php";
$log_str="a=b&c=d";
$ret=micat_post($url,$log_str);
function micat_post($url,$content) {

	$content_length = strlen($content);
	$options = array(
	'http'=>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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-26 23:45 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC