summaryrefslogtreecommitdiff
path: root/sapi/apache2handler/sapi_apache2.c
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2003-07-11 04:23:34 +0000
committerfoobar <sniper@php.net>2003-07-11 04:23:34 +0000
commitd6430ab79f964ace209f639bdb92dd89ba74d715 (patch)
treec74978cd304f65b87f6ab62ac48add1e2264600f /sapi/apache2handler/sapi_apache2.c
parent5aeedb4c88717e50ee362b2d36c560ee0cff63c2 (diff)
downloadphp-git-d6430ab79f964ace209f639bdb92dd89ba74d715.tar.gz
- Fixed bug #21074 (Apache2: "ErrorDocument xxx /error.php" broken). (Jani)
Diffstat (limited to 'sapi/apache2handler/sapi_apache2.c')
-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 5a0095917b..d496eaa946 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -465,9 +465,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) {