Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42902 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49116 invoked from network); 3 Feb 2009 18:41:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2009 18:41:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 209.85.162.183 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 209.85.162.183 el-out-1112.google.com Received: from [209.85.162.183] ([209.85.162.183:45361] helo=el-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/7E-03479-1EF88894 for ; Tue, 03 Feb 2009 13:41:37 -0500 Received: by el-out-1112.google.com with SMTP id r27so928532ele.2 for ; Tue, 03 Feb 2009 10:41:35 -0800 (PST) Received: by 10.142.218.4 with SMTP id q4mr2465223wfg.225.1233686494592; Tue, 03 Feb 2009 10:41:34 -0800 (PST) Received: from monster.local ([76.84.30.125]) by mx.google.com with ESMTPS id 22sm5644761wfg.19.2009.02.03.10.41.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 03 Feb 2009 10:41:33 -0800 (PST) Message-ID: <49888FDB.1070309@chiaraquartet.net> Date: Tue, 03 Feb 2009 12:41:31 -0600 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: php-dev List References: <5EC76153-898F-49C2-BDF1-C227578DB874@pooteeweet.org> <4454EC92-2977-4AF6-818F-49AE9F6F451B@pooteeweet.org> In-Reply-To: <4454EC92-2977-4AF6-818F-49AE9F6F451B@pooteeweet.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] towards the next 5.3 release From: greg@chiaraquartet.net (Greg Beaver) 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