summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php5.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2008-03-17 18:27:08 +0000
committerRasmus Lerdorf <rasmus@php.net>2008-03-17 18:27:08 +0000
commit42d4cf65311ecc790c21a1693360a0e7ca1f423e (patch)
tree2bbf5bb7edfdb7b19f7c20a26701e894be9c3a75 /sapi/apache/mod_php5.c
parentbafb0b4ff5ec13509e99bbecf23949d233885e2f (diff)
downloadphp-git-42d4cf65311ecc790c21a1693360a0e7ca1f423e.tar.gz
Revert
Never mind, it looks like ext/filter does an estrdup on everything it gets which doesn't seem very efficient to me as most things it gets passed will already be emalloc'ed. My custom version of the filter extension doesn't do this which led to the confusion.
Diffstat (limited to 'sapi/apache/mod_php5.c')
-rw-r--r--sapi/apache/mod_php5.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 0845f8e40b..d84b11e548 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -243,12 +243,14 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
table_entry *elts = (table_entry *) arr->elts;
zval **path_translated;
HashTable *symbol_table;
- int val_len, new_val_len;
- char *val;
+ int new_val_len;
for (i = 0; i < arr->nelts; i++) {
+ char *val;
+ int val_len;
+
if (elts[i].val) {
- val = estrdup(elts[i].val);
+ val = elts[i].val;
} else {
val = "";
}
@@ -273,9 +275,8 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC);
}
- val = estrdup(((request_rec *)SG(server_context))->uri);
- if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", val, strlen(val), &new_val_len TSRMLS_CC)) {
- php_register_variable_safe("PHP_SELF", val, new_val_len, track_vars_array TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &((request_rec *) SG(server_context))->uri, strlen(((request_rec *) SG(server_context))->uri), &new_val_len TSRMLS_CC)) {
+ php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC);
}
}
/* }}} */