Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25731 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70679 invoked by uid 1010); 16 Sep 2006 14:32:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 70664 invoked from network); 16 Sep 2006 14:32:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2006 14:32:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.185 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 64.233.182.185 nf-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.182.185] ([64.233.182.185:8590] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/0B-23155-B0B0C054 for ; Sat, 16 Sep 2006 10:32:44 -0400 Received: by nf-out-0910.google.com with SMTP id y25so2870134nfb for ; Sat, 16 Sep 2006 07:32:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fAlGdvn4lENT3AMCSlDhMGGOfjLnqn8EMuKdyDboCKFFBcufBYIogFD6T1KWRLUe6P/H/I0iwPAD5g5OnYkZ2Bub0sZfCxLY/4X0OLbVpASf0+I+hva68dMhUrVggXQPasw7gv0tsoK0ZHNJ52iFt48pHy3KeEMbDuF14EtaPaM= Received: by 10.78.150.7 with SMTP id x7mr2388354hud; Sat, 16 Sep 2006 07:32:40 -0700 (PDT) Received: by 10.78.137.6 with HTTP; Sat, 16 Sep 2006 07:32:39 -0700 (PDT) Message-ID: Date: Sat, 16 Sep 2006 16:32:40 +0200 To: "Christian Schneider" Cc: internals@lists.php.net, derick@php.net, rasmus@php.net, ilia@prohost.org In-Reply-To: <450C02B3.10103@cschneid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060916125431.42e9a5dd@pierre-u64> <450C02B3.10103@cschneid.com> Subject: Re: ext/filter, Final API proposal From: pierre.php@gmail.com (Pierre) Hello, On 9/16/06, Christian Schneider wrote: > Pierre wrote: > > Proposal: > > ********** > > > > I. Availalbe functions: > > ------------------- > > > > * input_get > > Gets variable from outside PHP or from a userland variable and > > optionally filters it using one filter and its options or flags. It > > accepts only scalar by default, array can be returned using > > ALLOW_ARRAY. > > Looks good. > > > * input_get_args > > Gets multiple variables from outside PHP or from a userland variable > > and optionally filters them using different filters and options/flags. > > It accepts only scalar by default, array can be returned using > > ALLOW_ARRAY. > > The current documentation page shows an example where all return values > are an array: > array(6) { > ["product_id"]=> > array(1) { > [0]=> > string(17) "libgd%3Cscript%3E" > } > ... > > I would prefer if it would return > array(6) { > ["product_id"]=> > string(17) "libgd%3Cscript%3E" > ... > unless FILTER_FLAG_ARRAY is given in which case it should behave like > before. This would make it easier to use the filtered values IMHO. It always returns an array when FILTER_FLAG_ARRAY is given. Even when the input value was a scalar. It spares yet another is_array/isset test. And it accepts only scalar by default or when FILTER_FLAG_SCALAR is given. >> II input_get > > II.1 without options or flags > > > > ?mystring=bold > > input_get(INPUT_POST, 'mystring', FILTER_SANITIZE_SPECIAL_CHARS); > > The documentation mentions 99 as $_REQUEST for input type right now. I'd > prefer to be able to say INPUT_GET | INPUT_POST to get values from a > combination of sources. Or at least have INPUT_REQUEST as constant > definition instead of 99. It uses INPUT_REQUEST (which is not yet implemented, and will not be for 5.2.0). One should rely only on the constants not their values :) However, the point was about the API changes (signature, way to call them, etc...). I suppose you like it? --Pierre