Bug #73590 [NEW]: stream_filter_append error with fopen on an url
| From: | marcimat at rezo dot net | Date: | Wed, 23 Nov 2016 14:13:21 +0000 |
| Subject: | Bug #73590 [NEW]: stream_filter_append error with fopen on an url | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205576@lists.php.net to get a copy of this message | ||
From: marcimat at rezo dot net
Operating system: macOS Sierra 10.12.1
PHP version: 7.0.13
Package: Streams related
Bug Type: Bug
Bug description:stream_filter_append error with fopen on an url
Description:
------------
When using a user created php_user_filter, attached to a url stream
(with fopen), the error "Warning: stream_filter_append(): Filter failed
to process pre-buffered data in ..." occured.
- There is/was no error in PHP 5.6.27.
- There is no error if fopen open a local file.
- There is no error with the integrated 'string.toupper' filter.
Test script:
---------------
Short :
// Example class strtoupper in
http://php.net/manual/en/function.stream-filter-register.php#example-4575
stream_filter_register('strtoupper', 'strtoupper_filter');
$fp = fopen('http://localhost/test.txt',
'r');
stream_filter_append($fp, 'strtoupper', STREAM_FILTER_READ); # DOES NOT
WORK
Complete example :
https://gist.github.com/anonymous/7b22c14390d3e831a8d472aad00baeee
Expected result:
----------------
No error (and the text print in uppercase)
Actual result:
--------------
No error in PHP 5.6
Error in PHP 7.0.12 (Warning: stream_filter_append(): Filter failed to
process pre-buffered data in xxx)
--
Edit bug report at https://bugs.php.net/bug.php?id=73590&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73590&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73590&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73590&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73590&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73590&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73590&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73590&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73590&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73590&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73590&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73590&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73590&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73590&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73590&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73590&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73590&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73590&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73590&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73590&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73590&r=mysqlcfg