summaryrefslogtreecommitdiff
path: root/sapi/apache2handler
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2003-07-11 04:24:11 +0000
committerfoobar <sniper@php.net>2003-07-11 04:24:11 +0000
commit894e2f15f04dd37de7e109eb5e75e85a16f6c76d (patch)
treeda2612b3a614e3743b9786410286cc5b0b6489ac /sapi/apache2handler
parente7175cbecf46448a4f393d3c56e385b6c36b27d4 (diff)
downloadphp-git-894e2f15f04dd37de7e109eb5e75e85a16f6c76d.tar.gz
MFH: Fixed bug #21074 (Apache2: "ErrorDocument xxx /error.php" broken).
Diffstat (limited to 'sapi/apache2handler')
-rw-r--r--sapi/apache2handler/sapi_apache2.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 81ea318130..5e64c5161c 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -470,9 +470,15 @@ static int php_handler(request_rec *r)
return DECLINED;
}
- /* setup standard CGI variables */
- ap_add_common_vars(r);
- ap_add_cgi_vars(r);
+ /* Setup the CGI variables if this is the main request */
+ if (r->main == NULL ||
+ /* .. or if the sub-request envinronment differs from the main-request. */
+ r->subprocess_env != r->main->subprocess_env
+ ) {
+ /* setup standard CGI variables */
+ ap_add_common_vars(r);
+ ap_add_cgi_vars(r);
+ }
ctx = SG(server_context);
if (ctx == NULL) {