sniper          Fri Jul 11 00:24:11 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/sapi/apache2filter sapi_apache2.c 
    /php-src/sapi/apache2handler        sapi_apache2.c 
  Log:
  MFH: Fixed bug #21074 (Apache2: "ErrorDocument xxx /error.php" broken).
  
  
Index: php-src/sapi/apache2filter/sapi_apache2.c
diff -u php-src/sapi/apache2filter/sapi_apache2.c:1.91.2.16 
php-src/sapi/apache2filter/sapi_apache2.c:1.91.2.17
--- php-src/sapi/apache2filter/sapi_apache2.c:1.91.2.16 Fri May 30 21:37:44 2003
+++ php-src/sapi/apache2filter/sapi_apache2.c   Fri Jul 11 00:24:11 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sapi_apache2.c,v 1.91.2.16 2003/05/31 01:37:44 sniper Exp $ */
+/* $Id: sapi_apache2.c,v 1.91.2.17 2003/07/11 04:24:11 sniper Exp $ */
 
 #include <fcntl.h>
 
@@ -435,10 +435,16 @@
                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: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.16 
php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.17
--- php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.16 Fri May 30 21:37:44 2003
+++ php-src/sapi/apache2handler/sapi_apache2.c  Fri Jul 11 00:24:11 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sapi_apache2.c,v 1.1.2.16 2003/05/31 01:37:44 sniper Exp $ */
+/* $Id: sapi_apache2.c,v 1.1.2.17 2003/07/11 04:24:11 sniper Exp $ */
 
 #include <fcntl.h>
 
@@ -470,9 +470,15 @@
                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) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to