ID: 41201
Updated by: [EMAIL PROTECTED]
Reported By: rganogork at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Filter related
Operating System: Gentoo Linux
PHP Version: 5.2.1
-Assigned To:
+Assigned To: pollita
Previous Comments:
------------------------------------------------------------------------
[2007-04-26 13:24:55] rganogork at gmail dot com
Description:
------------
If the input stream is filtered then fgets($stdin) does not return when
newline is typed.
Reproduce code:
---------------
<?php
class test_filter extends php_user_filter {
public function filter($in, $out, &$consumed, $closing) {
while ($bucket = stream_bucket_make_writeable($in)) {
$bucket->data = strtoupper($bucket->data);
$consumed += $bucket->datalen;
stream_bucket_append($out, $bucket);
}
return PSFS_PASS_ON;
}
}
$stdin = fopen("php://stdin", "r");
stream_filter_register("test.23", "test_filter");
stream_filter_append($stdin, "test.23");
fgets($stdin);
?>
Expected result:
----------------
Should return after newline. It does return if you comment the 2
stream... lines.
Actual result:
--------------
It hangs, probably waiting for more input.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41201&edit=1