Bug #66932 [NEW]: User stream filter errors cannot be handled

From: Date: Wed, 19 Mar 2014 11:09:19 +0000
Subject: Bug #66932 [NEW]: User stream filter errors cannot be handled
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184829@lists.php.net to get a copy of this message
From:             ezzatron at gmail dot com
Operating system: OS X 10.9.2
PHP version:      5.5.10
Package:          Streams related
Bug Type:         Bug
Bug description:User stream filter errors cannot be handled

Description:
------------
The constant PSFS_ERR_FATAL used to indicate an error condition in a
user stream filter has no effect on the return value of relevant stream
functions, and there is no alternative way to detect these errors.

Test script:
---------------
<?php

class FatalFilter extends php_user_filter
{
    function filter($in, $out, &$consumed, $closing)
    {
        $bucket = stream_bucket_make_writeable($in);

        return PSFS_ERR_FATAL;
    }
}

stream_filter_register('fatal', 'FatalFilter');

$stream = fopen('php://memory', 'wb');
stream_filter_append($stream, 'fatal');
var_dump(fwrite($stream, 'foobar'));
fclose($stream);


Expected result:
----------------
bool(false)

Actual result:
--------------
int(0)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=66932&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66932&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66932&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66932&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66932&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66932&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66932&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66932&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66932&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66932&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66932&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66932&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66932&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66932&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66932&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66932&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66932&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66932&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66932&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66932&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66932&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#184829) next »