php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34666 print and echo do not apply filters on STDOUT
Submitted: 2005-09-27 22:34 UTC Modified: 2016-12-30 23:10 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: squasar at eternalviper dot net Assigned:
Status: Open Package: Streams related
PHP Version: 5.1.0RC1 OS: Mac OS X 10.4.2/Darwin 8.2.0
Private report: No CVE-ID: None
 [2005-09-27 22:34 UTC] squasar at eternalviper dot net
Description:
------------
When using the CLI SAPI, installing filters on STDOUT with 
stream_filter_prepend()/stream_filter_append() does not apply 
those filters when print or echo are used. Suggested fix: have 
sapi_cli_single_write() in sapi/cli/php_cli.c use 
php_stream_write() instead of write()/fwrite() (possibly based 
on a ./configure option?)

Reproduce code:
---------------
<?php
stream_filter_append( STDOUT, "string.rot13" );
fprintf( STDOUT, "abcd\n" );
print "abcd\n";
?>

Expected result:
----------------
nopq
nopq


Actual result:
--------------
nopq
abcd


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 23:10 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Streams related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 04:01:27 2024 UTC