]> granicus.if.org Git - php/commitdiff
- Fixed bug #21074 (Apache2: "ErrorDocument xxx /error.php" broken). (Jani)
authorfoobar <sniper@php.net>
Fri, 11 Jul 2003 04:23:34 +0000 (04:23 +0000)
committerfoobar <sniper@php.net>
Fri, 11 Jul 2003 04:23:34 +0000 (04:23 +0000)
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c

index f53407c5511fedcc496976b301f6254b9cbb1640..176a0227f4f52f64fa1bc9c21bde07465d3c5011 100644 (file)
@@ -435,10 +435,16 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
                return ap_pass_brigade(f->next, bb);
        }
 
-       /* setup standard CGI variables */
-       ap_add_common_vars(f->r);
-       ap_add_cgi_vars(f->r);
-
+       /* Setup the CGI variables if this is the main request.. */
+       if (f->r->main == NULL || 
+               /* .. or if the sub-request envinronment differs from the main-request. */
+               f->r->subprocess_env != f->r->main->subprocess_env
+       ) {
+               /* setup standard CGI variables */
+               ap_add_common_vars(f->r);
+               ap_add_cgi_vars(f->r);
+       }
+       
        ctx = SG(server_context);
        if (ctx == NULL) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, f->r,
index 5a0095917b64c7665a87ac605db52ef020dae74a..d496eaa9468c34384ebef5290f5496d6441ec295 100644 (file)
@@ -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) {