ID: 43222 Updated by: [EMAIL PROTECTED] Reported By: lihonggang at 100 dot cn -Status: Open +Status: Feedback Bug Type: URL related Operating System: * PHP Version: 5.2CVS-2007-11-09 (CVS) New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2007-11-09 03:32:52] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43222&edit=1
