From: squasar at eternalviper dot net Operating system: Mac OS X 10.4.2/Darwin 8.2.0 PHP version: 5.1.0RC1 PHP Bug Type: CGI related Bug description: print and echo do not apply filters on STDOUT
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 -- Edit bug report at http://bugs.php.net/?id=34666&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34666&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34666&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34666&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34666&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34666&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34666&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34666&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34666&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34666&r=support Expected behavior: http://bugs.php.net/fix.php?id=34666&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34666&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34666&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34666&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34666&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34666&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34666&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34666&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34666&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34666&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34666&r=mysqlcfg