edink Tue Jun 3 06:08:18 2003 EDT Modified files: (Branch: PHP_4_3) /php4 php.ini-dist php.ini-recommended /php4/main SAPI.c /php4/sapi/cgi cgi_main.c Log: MFH (bugfix #23902 by Shane). Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.171.2.13 php4/php.ini-dist:1.171.2.14 --- php4/php.ini-dist:1.171.2.13 Sun May 25 14:35:18 2003 +++ php4/php.ini-dist Tue Jun 3 06:08:17 2003 @@ -463,7 +463,7 @@ ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that ; is supported by Apache. When this option is set to 1 PHP will send ; RFC2616 compliant header. -; Set to 1 if running under IIS. Default is zero. +; Default is zero. ;cgi.rfc2616_headers = 0 Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.119.2.11 php4/php.ini-recommended:1.119.2.12 --- php4/php.ini-recommended:1.119.2.11 Sun May 25 14:35:18 2003 +++ php4/php.ini-recommended Tue Jun 3 06:08:17 2003 @@ -478,7 +478,7 @@ ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that ; is supported by Apache. When this option is set to 1 PHP will send ; RFC2616 compliant header. -; Set to 1 if running under IIS. Default is zero. +; Default is zero. ;cgi.rfc2616_headers = 0 Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.155.2.9 php4/main/SAPI.c:1.155.2.10 --- php4/main/SAPI.c:1.155.2.9 Tue Feb 11 18:30:13 2003 +++ php4/main/SAPI.c Tue Jun 3 06:08:17 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: SAPI.c,v 1.155.2.9 2003/02/11 23:30:13 moriyoshi Exp $ */ +/* $Id: SAPI.c,v 1.155.2.10 2003/06/03 10:08:17 edink Exp $ */ #include <ctype.h> #include <sys/stat.h> @@ -456,6 +456,12 @@ static void sapi_update_response_code(int ncode TSRMLS_DC) { + /* if the status code did not change, we do not want + to change the status line, and no need to change the code */ + if (SG(sapi_headers).http_response_code == ncode) { + return; + } + if (SG(sapi_headers).http_status_line) { efree(SG(sapi_headers).http_status_line); SG(sapi_headers).http_status_line = NULL; Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.190.2.37 php4/sapi/cgi/cgi_main.c:1.190.2.38 --- php4/sapi/cgi/cgi_main.c:1.190.2.37 Sat May 31 13:02:01 2003 +++ php4/sapi/cgi/cgi_main.c Tue Jun 3 06:08:17 2003 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.190.2.37 2003/05/31 17:02:01 moriyoshi Exp $ */ +/* $Id: cgi_main.c,v 1.190.2.38 2003/06/03 10:08:17 edink Exp $ */ #include "php.h" #include "php_globals.h" @@ -303,7 +303,7 @@ if (SG(sapi_headers).http_response_code != 200) { int len; - if (rfc2616_headers) { + if (rfc2616_headers && SG(sapi_headers).http_status_line) { len = snprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH, "%s\r\n", SG(sapi_headers).http_status_line);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php