]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #27026 (Added cgi.nph that allows forcing of the Status: 200
authorIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2004 00:03:44 +0000 (00:03 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2004 00:03:44 +0000 (00:03 +0000)
header that is not normally needed).

NEWS
php.ini-dist
php.ini-recommended
sapi/cgi/cgi_main.c

diff --git a/NEWS b/NEWS
index b22fb40e527b19483857addd2bfd1e0a5c298d5e..d2775055a0f9167ce42dafd5c643646fac42ed96 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ PHP 4                                                                      NEWS
 - Fixed bug #27171 (crash inside gmp_hamdist()). (Jani)
 - Fixed bug #27149 (broken CLOB support in oci8 extension). (Antony)
 - Fixed bug #27135 (Possible crash inside mb_strlen()). (Moriyoshi)
+- Fixed bug #27026 (Added cgi.nph that allows forcing of the Status: 200
+  header that is not normally needed). (Ilia)
 - Fixed bug #24773 (unseting of strings as arrays causes a crash). (Sara)
 
 03 Feb 2004, Version 4.3.5RC2
index d746bcb75f492c1721444192dea024200ac17888..132b7920ececf8d24cd4b36419e56f3cd3fac50d 100644 (file)
@@ -438,6 +438,10 @@ enable_dl = On
 ; **You CAN safely turn this off for IIS, in fact, you MUST.**
 ; cgi.force_redirect = 1
 
+; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
+; every request.
+; cgi.nph = 1
+
 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 
 ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
 ; will look for to know it is OK to continue execution.  Setting this variable MAY
index 7e1d90c1da588b47de1381443a982503e870311d..8d2345b1f0b7284d0a9d0494a317e40776122b82 100644 (file)
@@ -453,6 +453,10 @@ enable_dl = On
 ; **You CAN safely turn this off for IIS, in fact, you MUST.**
 ; cgi.force_redirect = 1
 
+; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
+; every request.
+; cgi.nph = 1
+
 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 
 ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
 ; will look for to know it is OK to continue execution.  Setting this variable MAY
index 2c8946cae2a0ae6b6f9ae26b21688f59e54217a5..292ccfdf6db123bae4c835bd6cd1f0eea3db93c9 100644 (file)
@@ -293,7 +293,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
        char buf[SAPI_CGI_MAX_HEADER_LENGTH];
        sapi_header_struct *h;
        zend_llist_position pos;
-       long rfc2616_headers = 0;
+       long rfc2616_headers = 0, nph = 0;
 
        if(SG(request_info).no_headers == 1) {
                return  SAPI_HEADER_SENT_SUCCESSFULLY;
@@ -307,7 +307,11 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
                rfc2616_headers = 0;
        }
 
-       if (SG(sapi_headers).http_response_code != 200) {
+       if (cfg_get_long("cgi.nph", &nph) == FAILURE) {
+               nph = 0;
+       }
+
+       if (nph || SG(sapi_headers).http_response_code != 200) {
                int len;
                
                if (rfc2616_headers && SG(sapi_headers).http_status_line) {