From: lihonggang at 100 dot cn Operating system: FC6 PHP version: 5.2CVS-2007-11-09 (CVS) PHP Bug Type: URL related Bug description: stream_context_create bug s
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 bug report at http://bugs.php.net/?id=43222&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43222&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43222&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43222&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43222&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43222&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43222&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43222&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43222&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43222&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43222&r=support Expected behavior: http://bugs.php.net/fix.php?id=43222&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43222&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43222&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43222&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43222&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43222&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43222&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43222&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43222&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43222&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43222&r=mysqlcfg