Merge branch 'PHP-5.6'

* PHP-5.6:
  duplicate value's string for the SAPI filter
  Fine tuned the order of adding request variables.
This commit is contained in:
Michael Wallner 2014-09-09 06:56:33 +02:00
commit a6c47caf25

View File

@ -243,7 +243,7 @@ typedef struct post_var_data {
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC) static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC)
{ {
char *ksep, *vsep; char *ksep, *vsep, *val;
size_t klen, vlen; size_t klen, vlen;
/* FIXME: string-size_t */ /* FIXME: string-size_t */
size_t new_vlen; size_t new_vlen;
@ -274,15 +274,17 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR
vlen = 0; vlen = 0;
} }
php_url_decode(var->ptr, klen); php_url_decode(var->ptr, klen);
val = estrndup(ksep, vlen);
if (vlen) { if (vlen) {
vlen = php_url_decode(ksep, vlen); vlen = php_url_decode(val, vlen);
} }
if (sapi_module.input_filter(PARSE_POST, var->ptr, &ksep, vlen, &new_vlen TSRMLS_CC)) { if (sapi_module.input_filter(PARSE_POST, var->ptr, &val, vlen, &new_vlen TSRMLS_CC)) {
php_register_variable_safe(var->ptr, ksep, new_vlen, arr TSRMLS_CC); php_register_variable_safe(var->ptr, val, new_vlen, arr TSRMLS_CC);
} }
efree(val);
var->ptr = vsep + (vsep != var->end); var->ptr = vsep + (vsep != var->end);
return 1; return 1;