summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2003-11-26 09:53:22 +0000
committerDerick Rethans <derick@php.net>2003-11-26 09:53:22 +0000
commit370dfd39a9822428663acd98e9e1e86a38c072c0 (patch)
treec1194e0abdc531d15b6974426a056142b5ca5557 /main/php_variables.c
parent7780cbc9f339bf0abfca5544dbd1cfeb08f68c77 (diff)
downloadphp-git-370dfd39a9822428663acd98e9e1e86a38c072c0.tar.gz
- Prevent registration of the variable when a zero-length is returned
from the sapi_input_filter.
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 78b1863fd9..ae59eced6c 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -213,7 +213,9 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
php_url_decode(var, strlen(var));
val_len = php_url_decode(val, strlen(val));
val_len = sapi_module.input_filter(PARSE_POST, var, &val, val_len TSRMLS_CC);
- php_register_variable_safe(var, val, val_len, array_ptr TSRMLS_CC);
+ if (val_len) {
+ php_register_variable_safe(var, val, val_len, array_ptr TSRMLS_CC);
+ }
}
var = php_strtok_r(NULL, "&", &strtok_buf);
}
@@ -308,7 +310,9 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
php_url_decode(var, strlen(var));
val_len = php_url_decode(val, strlen(val));
val_len = sapi_module.input_filter(arg, var, &val, val_len TSRMLS_CC);
- php_register_variable_safe(var, val, val_len, array_ptr TSRMLS_CC);
+ if (val_len) {
+ php_register_variable_safe(var, val, val_len, array_ptr TSRMLS_CC);
+ }
} else {
php_url_decode(var, strlen(var));
php_register_variable_safe(var, "", 0, array_ptr TSRMLS_CC);