summaryrefslogtreecommitdiff
path: root/sapi/apache
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/apache
parentd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff)
downloadphp-upstream/5.2.2.tar.gz
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'sapi/apache')
-rw-r--r--sapi/apache/libpre.c4
-rw-r--r--sapi/apache/mod_php5.c23
-rw-r--r--sapi/apache/mod_php5.h4
-rw-r--r--sapi/apache/php_apache.c20
-rw-r--r--sapi/apache/php_apache_http.h4
-rw-r--r--sapi/apache/sapi_apache.c4
6 files changed, 28 insertions, 31 deletions
diff --git a/sapi/apache/libpre.c b/sapi/apache/libpre.c
index 3556883d2..e8e52c869 100644
--- a/sapi/apache/libpre.c
+++ b/sapi/apache/libpre.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: libpre.c,v 1.6.2.1 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: libpre.c,v 1.6.2.1.2.1 2007/01/01 09:36:12 sebastian Exp $ */
#ifdef NETWARE
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 118b9cfc9..d49901ff9 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.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 |
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.19.2.7.2.6 2006/10/12 20:02:58 bfrance Exp $ */
+/* $Id: mod_php5.c,v 1.19.2.7.2.9 2007/01/01 09:36:12 sebastian Exp $ */
#include "php_apache_http.h"
#include "http_conf_globals.h"
@@ -246,10 +246,11 @@ 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 new_val_len;
for (i = 0; i < arr->nelts; i++) {
char *val;
- int val_len, new_val_len;
+ int val_len;
if (elts[i].val) {
val = elts[i].val;
@@ -277,7 +278,9 @@ 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);
}
- php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, 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);
+ }
}
/* }}} */
@@ -673,16 +676,10 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
static int send_parsed_php(request_rec * r)
{
int result = send_php(r, 0, NULL);
-
-#if MEMORY_LIMIT
- {
- char *mem_usage;
- TSRMLS_FETCH();
+ TSRMLS_FETCH();
- mem_usage = ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC));
- ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage);
- }
-#endif
+ ap_table_setn(r->notes, "mod_php_memory_usage",
+ ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC)));
return result;
}
diff --git a/sapi/apache/mod_php5.h b/sapi/apache/mod_php5.h
index 5a1e4f839..b9bc6cc99 100644
--- a/sapi/apache/mod_php5.h
+++ b/sapi/apache/mod_php5.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 |
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf <rasmus@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.h,v 1.4.2.1 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: mod_php5.h,v 1.4.2.1.2.1 2007/01/01 09:36:12 sebastian Exp $ */
#ifndef MOD_PHP5_H
#define MOD_PHP5_H
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 18671af8a..70d999bdd 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.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 |
@@ -17,7 +17,7 @@
| David Sklar <sklar@student.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.c,v 1.89.2.4.2.1 2006/09/06 11:54:28 nlopess Exp $ */
+/* $Id: php_apache.c,v 1.89.2.4.2.5 2007/02/24 02:17:28 helly Exp $ */
#include "php_apache_http.h"
@@ -207,20 +207,20 @@ PHP_MINFO_FUNCTION(apache)
}
#ifdef APACHE_RELEASE
- sprintf(output_buf, "%d", APACHE_RELEASE);
+ snprintf(output_buf, sizeof(output_buf), "%d", APACHE_RELEASE);
php_info_print_table_row(2, "Apache Release", output_buf);
#endif
- sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER);
+ snprintf(output_buf, sizeof(output_buf), "%d", MODULE_MAGIC_NUMBER);
php_info_print_table_row(2, "Apache API Version", output_buf);
- sprintf(output_buf, "%s:%u", serv->server_hostname, serv->port);
+ snprintf(output_buf, sizeof(output_buf), "%s:%u", serv->server_hostname, serv->port);
php_info_print_table_row(2, "Hostname:Port", output_buf);
#if !defined(WIN32) && !defined(WINNT)
- sprintf(output_buf, "%s(%d)/%d", user_name, (int)user_id, (int)group_id);
+ snprintf(output_buf, sizeof(output_buf), "%s(%d)/%d", user_name, (int)user_id, (int)group_id);
php_info_print_table_row(2, "User/Group", output_buf);
- sprintf(output_buf, "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max);
+ snprintf(output_buf, sizeof(output_buf), "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max);
php_info_print_table_row(2, "Max Requests", output_buf);
#endif
- sprintf(output_buf, "Connection: %d - Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout);
+ snprintf(output_buf, sizeof(output_buf), "Connection: %d - Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout);
php_info_print_table_row(2, "Timeouts", output_buf);
#if !defined(WIN32) && !defined(WINNT)
/*
@@ -235,9 +235,9 @@ PHP_MINFO_FUNCTION(apache)
if ((p = strrchr(name, '.'))) {
*p='\0'; /* Cut off ugly .c extensions on module names */
}
- strcat(modulenames, name);
+ strlcat(modulenames, name, sizeof(modulenames));
if (modp->next) {
- strcat(modulenames, ", ");
+ strlcat(modulenames, ", ", sizeof(modulenames));
}
}
php_info_print_table_row(2, "Loaded Modules", modulenames);
diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h
index 0926d1583..08f41cdc3 100644
--- a/sapi/apache/php_apache_http.h
+++ b/sapi/apache/php_apache_http.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 |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache_http.h,v 1.13.2.1 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: php_apache_http.h,v 1.13.2.1.2.1 2007/01/01 09:36:12 sebastian Exp $ */
#define NO_REGEX_EXTRA_H
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index d30a3b1f3..c8aad6c7f 100644
--- a/sapi/apache/sapi_apache.c
+++ b/sapi/apache/sapi_apache.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 |
@@ -19,7 +19,7 @@
| Stig Bakken <ssb@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache.c,v 1.47.2.1 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: sapi_apache.c,v 1.47.2.1.2.1 2007/01/01 09:36:12 sebastian Exp $ */
#include "php_apache_http.h"