ID: 22538 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Analyzed +Status: Closed Bug Type: Filesystem function related Operating System: RedHat Linux 8.0 (glibc-2.3.0) PHP Version: 5CVS-2003-03-04 (dev) Assigned To: iliaa New Comment:
This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-03-28 10:59:38] [EMAIL PROTECTED] I made a patch for this issue. But not sure if this is the right fix.. Index: main/streams/streams.c =================================================================== RCS file: /repository/php4/main/streams/streams.c,v retrieving revision 1.14 diff -u -r1.14 streams.c --- main/streams/streams.c 20 Mar 2003 01:23:04 -0000 1.14 +++ main/streams/streams.c 28 Mar 2003 16:50:31 -0000 @@ -829,7 +829,7 @@ /* Only screw with the buffer if we can seek, otherwise we lose data * buffered from fifos and sockets */ - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && !php_stream_is_filtered(stream)) { + if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { stream->position += justwrote; } } else { ------------------------------------------------------------------------ [2003-03-17 14:58:15] [EMAIL PROTECTED] And, hmm, here's another script to replicate with. By this script, It turned out that the issue isn't stream_copy_to_stream specific. <?php function my_stream_copy_to_stream($fin, $fout) { while (!feof($fin)) { fwrite($fout, fread($fin, 4096)); } } $fin = fopen("Zend/zend.c", "r"); $fout = fopen("/tmp/output", "w"); stream_filter_append($fout, "string.rot13"); my_stream_copy_to_stream($fin, $fout); fclose($fin); fclose($fout); ?> I don't have enough time to fix this right now, so I thank you for taking your time to look at this one ;-) ------------------------------------------------------------------------ [2003-03-17 14:34:13] [EMAIL PROTECTED] Oops, I forgot to try this one... script 4: <?php $fin = popen("cat Zend/zend.c", "r"); $fout = fopen("/tmp/output", "w"); stream_filter_append($fout, "string.rot13"); stream_copy_to_stream($fin, $fout); fclose($fin); fclose($fout); ?> This results in the same output. ------------------------------------------------------------------------ [2003-03-17 14:30:08] [EMAIL PROTECTED] The bug still persists. $ php script2.php < Zend/zend.c is ok, but it doesn't work with piped stream. Please try the following: $ cat script2.php | php script2.php ------------------------------------------------------------------------ [2003-03-17 12:33:46] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22538 -- Edit this bug report at http://bugs.php.net/?id=22538&edit=1
