This was a knee-jerk reaction to attempting to track down a heisenbug
which (you're right) was premature.  Turns out the bug had nothing to do
with the user_fitlers call, and everything to do with a bug in the Zend
engine memory allocation stack.  The oddity was that using the
BG(user_filter_map) rather than the php_stream_get_filters_hash() would
suppress the error (hence setting up a condition that would be less likely
to reproduce the problem).

Further exploration shows it to be completely coincidental though.  I'll
back this change out.

-Pollita

> I don't think this makes much sense and would prefer it to default to
> all filters if there is a good reason to keep the option.
>
> --Wez.
>
> On Tue, 7 Jan 2003, Sara Golemon wrote:
>
>> pollita              Mon Jan  6 20:02:30 2003 EDT
>>
>>   Modified files:
>>     /php4/ext/standard       user_filters.c
>>   Log:
>>   Add option to stream_get_filters() user-defined fiters vs. all
>> filters, default to user only
>>
>>
>> Index: php4/ext/standard/user_filters.c
>> diff -u php4/ext/standard/user_filters.c:1.6
>> php4/ext/standard/user_filters.c:1.7 ---
>> php4/ext/standard/user_filters.c:1.6 Sun Jan  5 23:06:40 2003 +++
>> php4/ext/standard/user_filters.c     Mon Jan  6 20:02:29 2003
>> @@ -17,7 +17,7 @@
>>     +----------------------------------------------------------------------+
>>  */
>>
>> -/* $Id: user_filters.c,v 1.6 2003/01/06 04:06:40 pollita Exp $ */ +/*
>> $Id: user_filters.c,v 1.7 2003/01/07 01:02:29 pollita Exp $ */
>>
>>  #include "php.h"
>>  #include "php_globals.h"
>> @@ -411,21 +411,27 @@
>>  {
>>  }
>>
>> -/* {{{ proto array stream_get_filters()
>> +/* {{{ proto array stream_get_filters([bool system])
>>     Returns a list of registered filters */
>>  PHP_FUNCTION(stream_get_filters)
>>  {
>>      char *filter_name;
>>      int key_flags, filter_name_len = 0;
>> +    zend_bool return_system = 0;
>>      HashTable *filters_hash;
>>
>> -    if (ZEND_NUM_ARGS() != 0) {
>> -            WRONG_PARAM_COUNT;
>> +    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b",
>> &return_system) == FAILURE) { +              RETURN_FALSE;
>>      }
>>
>>      array_init(return_value);
>>
>> -    filters_hash = php_get_stream_filters_hash();
>> +    /* TODO: Bug #21487 */
>> +
>> +    if (return_system)
>> +            filters_hash = php_get_stream_filters_hash();
>> +    else
>> +            filters_hash = BG(user_filter_map);
>>
>>      if (filters_hash) {
>>              for(zend_hash_internal_pointer_reset(filters_hash);
>>
>>
>>
>> --
>> PHP CVS Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to