php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73590 stream_filter_append error with fopen on an url
Submitted: 2016-11-23 14:13 UTC Modified: 2016-11-23 19:09 UTC
From: marcimat at rezo dot net Assigned: cmb (profile)
Status: Closed Package: Streams related
PHP Version: 7.0.13 OS: macOS Sierra 10.12.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marcimat at rezo dot net
New email:
PHP Version: OS:

 

 [2016-11-23 14:13 UTC] marcimat at rezo dot net
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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-23 19:09 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-11-23 19:09 UTC] cmb@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

Fixed with <http://git.php.net/?p=php-src.git;a=commit;h=a8d031fb>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 12:01:31 2024 UTC