]> granicus.if.org Git - php/commitdiff
Fix for #23902 by Shane.
authorEdin Kadribasic <edink@php.net>
Tue, 3 Jun 2003 10:06:45 +0000 (10:06 +0000)
committerEdin Kadribasic <edink@php.net>
Tue, 3 Jun 2003 10:06:45 +0000 (10:06 +0000)
Removed bogus recommendation from php.ini files.

# Basic authentication is actually possible
# usign IIS + PHP cgi countrary to our current docs

main/SAPI.c
php.ini-dist
php.ini-recommended
sapi/cgi/cgi_main.c

index 94a333c9671cb2b5ec04611d21c5f988cab0dc1d..43bcef72595b57abd72f80cfe81e9918c4a4e8e3 100644 (file)
@@ -456,6 +456,12 @@ static int sapi_extract_response_code(const char *header_line)
 
 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 06b49e138ceba694040eda386e34d2c724badea8..643588c21e34f444708d566e96e1a7f8787c87ea 100644 (file)
@@ -462,7 +462,7 @@ enable_dl = On
 ; 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 d95fc47e9192d804b4fdf7c122aca58f1a028ebc..21e5c4f59cb2f303bc17f3d59d7bf834f5c20aa1 100644 (file)
@@ -477,7 +477,7 @@ enable_dl = On
 ; 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 d8acfd1c3f18a30ef0b6feceb5bc9b3a2df6480e..ae9e9ed7cfc7ced4186fe1169b60b1e2488d7874 100644 (file)
@@ -303,7 +303,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
        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);