summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2011-12-22 15:31:41 +0000
committerDmitry Stogov <dmitry@php.net>2011-12-22 15:31:41 +0000
commit3305f5b1333cba5c45debb4f549382490f745758 (patch)
tree5efa74fba6028ab231765923ebd6224750466382 /main/php_variables.c
parent256dfd87ad9c2de5297998abcb04551e9c5783d8 (diff)
downloadphp-git-3305f5b1333cba5c45debb4f549382490f745758.tar.gz
Change fatal error into warning and ignore arguments over limit
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 976e9d5066..c96d7c63f9 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -179,12 +179,14 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
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)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ 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);
}
- 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);
@@ -223,10 +225,14 @@ plain_var:
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)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ 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);