PHP CVS 44 CVS PHP SRC PHP 4 3 SAPI APACHE2FILTER SAPI APACHE2 C SAPI APACHE2HANDLER SAPI APACHE2 C
Date: Fri, 11 Jul 2003 04:24:11 -0000

Subject: cvs: php-src(PHP_4_3) /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c
From: sniper@no-spam (Jani Taskinen)

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
@@no-spam -18,7 +18,7 @@no-spam +----------------------------------------------------------------------+
*/
-/* $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>
@@no-spam -435,10 +435,16 @@no-spam 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
@@no-spam -18,7 +18,7 @@no-spam +----------------------------------------------------------------------+
*/
-/* $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>
@@no-spam -470,9 +470,15 @@no-spam 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) {