Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: main/php_globals.h
- ===================================================================
- --- main/php_globals.h (revision 321752)
- +++ main/php_globals.h (working copy)
- @@ -146,7 +146,7 @@
- zend_bool com_initialized;
- #endif
- long max_input_nesting_level;
- - long max_input_vars;
- + long max_post_vars;
- zend_bool in_user_include;
- char *user_ini_filename;
- Index: main/php_variables.c
- ===================================================================
- --- main/php_variables.c (revision 321752)
- +++ main/php_variables.c (working copy)
- @@ -178,15 +178,10 @@
- } else {
- escaped_index = index;
- if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) &gpc_element_p) == FAILURE
- - || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
- - if (zend_hash_num_elements(symtable1) <= PG(max_input_vars)) {
- - if (zend_hash_num_elements(symtable1) == PG(max_input_vars)) {
- - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
- - }
- - MAKE_STD_ZVAL(gpc_element);
- - array_init(gpc_element);
- - zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
- - }
- + || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
- + MAKE_STD_ZVAL(gpc_element);
- + array_init(gpc_element);
- + zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
- }
- if (index != escaped_index) {
- efree(escaped_index);
- @@ -225,14 +220,7 @@
- zend_symtable_exists(symtable1, escaped_index, index_len + 1)) {
- zval_ptr_dtor(&gpc_element);
- } else {
- - if (zend_hash_num_elements(symtable1) <= PG(max_input_vars)) {
- - if (zend_hash_num_elements(symtable1) == PG(max_input_vars)) {
- - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
- - }
- - zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
- - } else {
- - zval_ptr_dtor(&gpc_element);
- - }
- + zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
- }
- if (escaped_index != index) {
- efree(escaped_index);
- @@ -246,6 +234,7 @@
- {
- char *var, *val, *e, *s, *p;
- zval *array_ptr = (zval *) arg;
- + long num_vars = 0;
- if (SG(request_info).post_data == NULL) {
- return;
- @@ -271,6 +260,10 @@
- efree(val);
- }
- s = p + 1;
- + if (++num_vars >= PG(max_post_vars)) {
- + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Post variables exceeded %ld. To increase the limit change max_post_vars in php.ini.", PG(max_post_vars));
- + return;
- + }
- }
- if (s < e) {
- p = e;
- Index: main/main.c
- ===================================================================
- --- main/main.c (revision 321752)
- +++ main/main.c (working copy)
- @@ -531,7 +531,7 @@
- STD_PHP_INI_ENTRY("post_max_size", "8M", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, post_max_size, sapi_globals_struct,sapi_globals)
- STD_PHP_INI_ENTRY("upload_tmp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, upload_tmp_dir, php_core_globals, core_globals)
- STD_PHP_INI_ENTRY("max_input_nesting_level", "64", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLongGEZero, max_input_nesting_level, php_core_globals, core_globals)
- - STD_PHP_INI_ENTRY("max_input_vars", "1000", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLongGEZero, max_input_vars, php_core_globals, core_globals)
- + STD_PHP_INI_ENTRY("max_post_vars", "1000", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLongGEZero, max_post_vars, php_core_globals, core_globals)
- STD_PHP_INI_ENTRY("user_dir", NULL, PHP_INI_SYSTEM, OnUpdateString, user_dir, php_core_globals, core_globals)
- STD_PHP_INI_ENTRY("variables_order", "EGPCS", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, variables_order, php_core_globalscore_globals)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement