summaryrefslogtreecommitdiff
path: root/sapi/apache2filter
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
commit2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (patch)
tree41ccc042009cba53e4ce43e727fcba4c1cfbf7f3 /sapi/apache2filter
parentd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff)
downloadphp-2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b.tar.gz
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'sapi/apache2filter')
-rw-r--r--sapi/apache2filter/apache_config.c4
-rw-r--r--sapi/apache2filter/php_apache.h4
-rw-r--r--sapi/apache2filter/php_functions.c8
-rw-r--r--sapi/apache2filter/sapi_apache2.c29
4 files changed, 26 insertions, 19 deletions
diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c
index eca894aaa..fe43075e8 100644
--- a/sapi/apache2filter/apache_config.c
+++ b/sapi/apache2filter/apache_config.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apache_config.c,v 1.34.2.1.2.1 2006/06/09 16:29:35 mike Exp $ */
+/* $Id: apache_config.c,v 1.34.2.1.2.2 2007/01/01 09:36:12 sebastian Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h
index 87e9baaa4..62bf682c3 100644
--- a/sapi/apache2filter/php_apache.h
+++ b/sapi/apache2filter/php_apache.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.h,v 1.25.2.1.2.1 2006/07/03 16:51:38 john Exp $ */
+/* $Id: php_apache.h,v 1.25.2.1.2.2 2007/01/01 09:36:12 sebastian Exp $ */
#ifndef PHP_APACHE_H
#define PHP_APACHE_H
diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c
index 0d23be263..7e4a6d8a8 100644
--- a/sapi/apache2filter/php_functions.c
+++ b/sapi/apache2filter/php_functions.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_functions.c,v 1.44.2.2 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: php_functions.c,v 1.44.2.2.2.2 2007/01/01 09:36:12 sebastian Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -289,7 +289,11 @@ PHP_FUNCTION(apache_getenv)
static char *php_apache_get_version()
{
+#if MODULE_MAGIC_NUMBER_MAJOR >= 20060905
+ return (char *) ap_get_server_banner();
+#else
return (char *) ap_get_server_version();
+#endif
}
/* {{{ proto string apache_get_version(void)
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 1ed582b40..9af6fa823 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.136.2.2.2.3 2006/07/25 13:40:05 dmitry Exp $ */
+/* $Id: sapi_apache2.c,v 1.136.2.2.2.8 2007/01/01 09:36:12 sebastian Exp $ */
#include <fcntl.h>
@@ -210,13 +210,21 @@ 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
@@ -434,10 +442,10 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
php_struct *ctx;
void *conf = ap_get_module_config(f->r->per_dir_config, &php5_module);
char *p = get_php_config(conf, "engine", sizeof("engine"));
- TSRMLS_FETCH();
zend_file_handle zfd;
php_apr_bucket_brigade *pbb;
apr_bucket *b;
+ TSRMLS_FETCH();
if (f->r->proxyreq) {
zend_try {
@@ -503,6 +511,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
return ap_pass_brigade(f->next, bb);
}
+ apply_config(conf);
php_apache_request_ctor(f, ctx TSRMLS_CC);
// It'd be nice if we could highlight based of a zend_file_handle here....
@@ -522,14 +531,8 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
php_execute_script(&zfd TSRMLS_CC);
-#if MEMORY_LIMIT
- {
- char *mem_usage;
-
- mem_usage = apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC));
- apr_table_set(ctx->r->notes, "mod_php_memory_usage", mem_usage);
- }
-#endif
+ apr_table_set(ctx->r->notes, "mod_php_memory_usage",
+ apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC)));
php_apache_request_dtor(f TSRMLS_CC);