stas Tue Apr 28 22:59:07 2009 UTC Modified files: /php-src/ext/filter filter.c /php-src/main SAPI.c SAPI.h php_content_types.c Log: MF5 fix for #47930 http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.103&r2=1.104&diff_format=u Index: php-src/ext/filter/filter.c diff -u php-src/ext/filter/filter.c:1.103 php-src/ext/filter/filter.c:1.104 --- php-src/ext/filter/filter.c:1.103 Tue Apr 14 14:18:14 2009 +++ php-src/ext/filter/filter.c Tue Apr 28 22:59:07 2009 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filter.c,v 1.103 2009/04/14 14:18:14 tony2001 Exp $ */ +/* $Id: filter.c,v 1.104 2009/04/28 22:59:07 stas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -76,6 +76,7 @@ #endif static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC); +static unsigned int php_sapi_filter_init(TSRMLS_D); /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_input, 0, 0, 2) @@ -270,7 +271,7 @@ REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_RES_RANGE", FILTER_FLAG_NO_RES_RANGE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_PRIV_RANGE", FILTER_FLAG_NO_PRIV_RANGE, CONST_CS | CONST_PERSISTENT); - sapi_register_input_filter(php_sapi_filter); + sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init); return SUCCESS; } @@ -312,7 +313,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.103 $"); + php_info_print_table_row( 2, "Revision", "$Revision: 1.104 $"); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -339,6 +340,17 @@ } /* }}} */ +static unsigned int php_sapi_filter_init(TSRMLS_D) +{ + IF_G(get_array) = NULL; + IF_G(post_array) = NULL; + IF_G(cookie_array) = NULL; + IF_G(server_array) = NULL; + IF_G(env_array) = NULL; + IF_G(session_array) = NULL; + return SUCCESS; +} + static void php_zval_filter(zval **value, long filter, long flags, zval *options, char* charset, zend_bool copy TSRMLS_DC) /* {{{ */ { filter_list_entry filter_func; http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.234&r2=1.235&diff_format=u Index: php-src/main/SAPI.c diff -u php-src/main/SAPI.c:1.234 php-src/main/SAPI.c:1.235 --- php-src/main/SAPI.c:1.234 Thu Mar 26 20:02:53 2009 +++ php-src/main/SAPI.c Tue Apr 28 22:59:07 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: SAPI.c,v 1.234 2009/03/26 20:02:53 felipe Exp $ */ +/* $Id: SAPI.c,v 1.235 2009/04/28 22:59:07 stas Exp $ */ #include <ctype.h> #include <sys/stat.h> @@ -345,6 +345,9 @@ sapi_module.activate(TSRMLS_C); } } + if (sapi_module.input_filter_init ) { + sapi_module.input_filter_init(TSRMLS_C); + } } /* @@ -411,6 +414,9 @@ sapi_module.activate(TSRMLS_C); } } + if (sapi_module.input_filter_init ) { + sapi_module.input_filter_init(TSRMLS_C); + } } @@ -852,13 +858,14 @@ return SUCCESS; } -SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)) +SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D)) { TSRMLS_FETCH(); if (SG(sapi_started) && EG(in_execution)) { return FAILURE; } sapi_module.input_filter = input_filter; + sapi_module.input_filter_init = input_filter_init; return SUCCESS; } http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.h?r1=1.128&r2=1.129&diff_format=u Index: php-src/main/SAPI.h diff -u php-src/main/SAPI.h:1.128 php-src/main/SAPI.h:1.129 --- php-src/main/SAPI.h:1.128 Tue Mar 10 23:39:53 2009 +++ php-src/main/SAPI.h Tue Apr 28 22:59:07 2009 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: SAPI.h,v 1.128 2009/03/10 23:39:53 helly Exp $ */ +/* $Id: SAPI.h,v 1.129 2009/04/28 22:59:07 stas Exp $ */ #ifndef SAPI_H #define SAPI_H @@ -192,7 +192,7 @@ SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC); SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D)); SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC)); -SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)); +SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D)); SAPI_API int sapi_flush(TSRMLS_D); SAPI_API struct stat *sapi_get_stat(TSRMLS_D); @@ -267,6 +267,7 @@ char *ini_entries; const zend_function_entry *additional_functions; + unsigned int (*input_filter_init)(TSRMLS_D); }; http://cvs.php.net/viewvc.cgi/php-src/main/php_content_types.c?r1=1.39&r2=1.40&diff_format=u Index: php-src/main/php_content_types.c diff -u php-src/main/php_content_types.c:1.39 php-src/main/php_content_types.c:1.40 --- php-src/main/php_content_types.c:1.39 Tue Mar 10 23:39:53 2009 +++ php-src/main/php_content_types.c Tue Apr 28 22:59:07 2009 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_content_types.c,v 1.39 2009/03/10 23:39:53 helly Exp $ */ +/* $Id: php_content_types.c,v 1.40 2009/04/28 22:59:07 stas Exp $ */ #include "php.h" #include "SAPI.h" @@ -75,7 +75,7 @@ { sapi_register_default_post_reader(php_default_post_reader); sapi_register_treat_data(php_default_treat_data); - sapi_register_input_filter(php_default_input_filter); + sapi_register_input_filter(php_default_input_filter, NULL); return SUCCESS; } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php