Lukas Kahwe Smith wrote:
> Hi,
> 
> I also just reopened:
> http://bugs.php.net/bug.php?id=46026
> 
> Not sure if Greg has time ..

Actually, this was more complex than originally stated, in that this
code is incorrect:

if (SUCCESS == zend_hash_find(HASH_OF(filterparams), "concatenated",
sizeof("concatenated"), (void **) &tmpzval) ) {
-    SEPARATE_ZVAL(tmpzval);
-    convert_to_boolean_ex(tmpzval);
     data->expect_concatenated = Z_LVAL_PP(tmpzval);
-    zval_ptr_dtor(tmpzval);
     tmpzval = NULL;
}

The reason being that it incorrectly uses whatever the zval is, thus any
hash table or object would evaluate to true, even an empty array or object.

Thus, the correct fix is the one implemented in zlib_filter.c, and I've
ported it over.  It involves using a temporary zval, zval_copy_ctor()ing
it, and then convert_to_boolean_ex()ing it, which leaves the original
zval alone (the SEPARATE_ZVAL call does not do this properly), and
provides a valid boolean value.  I'll commit momentarily.

Greg

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to