Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35768 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68333 invoked by uid 1010); 24 Feb 2008 15:37:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68318 invoked from network); 24 Feb 2008 15:37:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2008 15:37:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=antab@valka.is; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=antab@valka.is; sender-id=unknown Received-SPF: error (pb1.pair.com: domain valka.is from 213.176.128.13 cause and error) X-PHP-List-Original-Sender: antab@valka.is X-Host-Fingerprint: 213.176.128.13 vxout-1.c.is Linux 2.4/2.6 Received: from [213.176.128.13] ([213.176.128.13:57335] helo=vxout-1.c.is) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/CC-30812-34F81C74 for ; Sun, 24 Feb 2008 10:37:41 -0500 Received: from mail.internet.is (mail.aknet.is [193.4.194.58]) by vxout-1.c.is (Postfix) with ESMTP id 4B3413B999E for ; Sun, 24 Feb 2008 15:37:29 +0000 (GMT) Received: from [10.0.0.102] (postur.valka.is [194.144.27.37]) by mail.internet.is (Postfix) with ESMTP id 0916210E9 for ; Sun, 24 Feb 2008 15:37:28 +0000 (CUT) Message-ID: <3BA7F322-7E34-4F8D-BD2B-6F59DA3139FB@valka.is> To: internals@lists.php.net Content-Type: multipart/mixed; boundary=Apple-Mail-14-74465885 Mime-Version: 1.0 (Apple Message framework v919.2) Date: Sun, 24 Feb 2008 15:37:28 +0000 X-Mailer: Apple Mail (2.919.2) X-Vodafone-MailScanner-Information: Virusskannad hja Vodafone X-Vodafone-MailScanner: Found to be clean - Enginn virus fannst X-Vodafone-MailScanner-SpamCheck: ekki ruslpostur, SpamAssassin (notcached, stigagjof=0, required 5, autolearn=disabled) X-MailScanner-From: antab@valka.is Subject: [PATCH] Fix segfault in filter extension when using callbacks From: antab@valka.is (Arnar Mar Sig) --Apple-Mail-14-74465885 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit The filter extensinon will segfault if a callback filter returns FALSE, this little patch fixes that. There is also no way to set default value if the callback fails because of a design flow. When dealing with callbacks the 'options' key in the options parameters just be a valid callback, but to set a default value then this key must be a array that includes the key 'default'. Test case: function filter_test($str) { return FALSE; } var_dump(filter_var('durty/boy', FILTER_CALLBACK, array( 'options' => 'filter_test', ))); Arnar Mar Sig --Apple-Mail-14-74465885 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-14-74465885--