Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62998 invoked by uid 1010); 16 Sep 2006 13:57:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62983 invoked from network); 16 Sep 2006 13:57:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2006 13:57:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.42 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.42 darkcity.gna.ch Linux 2.5 (sometimes 2.4) (4) Received: from [195.226.6.42] ([195.226.6.42:34348] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/D9-23155-9B20C054 for ; Sat, 16 Sep 2006 09:57:14 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 8C93DC4310; Sat, 16 Sep 2006 15:57:10 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXo9JII1; Sat, 16 Sep 2006 15:57:09 +0200 (CEST) Received: from [192.168.1.42] (217-162-171-242.dclient.hispeed.ch [217.162.171.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id BD3B1C430E; Sat, 16 Sep 2006 15:57:08 +0200 (CEST) Message-ID: <450C02B3.10103@cschneid.com> Date: Sat, 16 Sep 2006 15:57:07 +0200 User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: pierre.php@gmail.com CC: internals@lists.php.net, derick@php.net, rasmus@php.net, ilia@prohost.org References: <20060916125431.42e9a5dd@pierre-u64> In-Reply-To: <20060916125431.42e9a5dd@pierre-u64> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: ext/filter, Final API proposal From: cschneid@cschneid.com (Christian Schneider) 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. > * input_has_variable > Checks if variable of specified type exists. > > * input_name_to_filter > Returns the filter ID belonging to a named filter > > * input_ filters_ list > Returns a list of all supported filters > > II input_get usages > > 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. My two cents, - Chris