mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Added filter support for $_SERVER in cgi/apache2 sapis
Make sure PHP_SELF if filtered in Apache 1 sapi
This commit is contained in:
parent
a0407cf588
commit
3642ebdcdd
4 changed files with 33 additions and 9 deletions
|
@ -232,13 +232,20 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
|
|||
php_struct *ctx = SG(server_context);
|
||||
const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env);
|
||||
char *key, *val;
|
||||
int new_val_len;
|
||||
|
||||
APR_ARRAY_FOREACH_OPEN(arr, key, val)
|
||||
if (!val) val = "";
|
||||
php_register_variable(key, val, track_vars_array TSRMLS_CC);
|
||||
if (!val) {
|
||||
val = "";
|
||||
}
|
||||
if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len TSRMLS_CC)) {
|
||||
php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC);
|
||||
}
|
||||
APR_ARRAY_FOREACH_CLOSE()
|
||||
|
||||
php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC);
|
||||
if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len TSRMLS_CC)) {
|
||||
php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue