iliaa Mon Oct 9 19:48:35 2006 UTC
Modified files:
/php-src/ext/filter filter.c
Log:
MFB: Improve parameter parsing
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.71&r2=1.72&diff_format=u
Index: php-src/ext/filter/filter.c
diff -u php-src/ext/filter/filter.c:1.71 php-src/ext/filter/filter.c:1.72
--- php-src/ext/filter/filter.c:1.71 Sun Oct 8 13:49:57 2006
+++ php-src/ext/filter/filter.c Mon Oct 9 19:48:35 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filter.c,v 1.71 2006/10/08 13:49:57 bjori Exp $ */
+/* $Id: filter.c,v 1.72 2006/10/09 19:48:35 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -273,7 +273,7 @@
{
php_info_print_table_start();
php_info_print_table_row( 2, "Input Validation and Filtering",
"enabled" );
- php_info_print_table_row( 2, "Revision", "$Revision: 1.71 $");
+ php_info_print_table_row( 2, "Revision", "$Revision: 1.72 $");
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
@@ -652,16 +652,18 @@
PHP_FUNCTION(filter_input)
{
long fetch_from, filter = FILTER_DEFAULT;
- zval **filter_args = NULL, **data=NULL, **tmp;
+ zval **filter_args = NULL, **tmp;
zval *input = NULL;
+ char *var;
+ int var_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lZ|lZ",
&fetch_from, &data, &filter, &filter_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|lZ",
&fetch_from, &var, &var_len, &filter, &filter_args) == FAILURE) {
RETURN_FALSE;
}
input = php_filter_get_storage(fetch_from TSRMLS_CC);
- if (!input || !HASH_OF(input) || zend_hash_find(HASH_OF(input),
Z_STRVAL_PP(data), Z_STRLEN_PP(data) + 1, (void **)&tmp) != SUCCESS) {
+ if (!input || !HASH_OF(input) || zend_hash_find(HASH_OF(input), var,
var_len + 1, (void **)&tmp) != SUCCESS) {
RETURN_FALSE;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php