Re: ext/filter, Final API proposal

From: Date: Sat, 16 Sep 2006 13:57:07 +0000
Subject: Re: ext/filter, Final API proposal
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-25730@lists.php.net to get a copy of this message
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=<b>bold</b> 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

« previous php.internals (#25730) next »