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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lihonggang at 100 dot cn
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 05:01:29 2024 UTC