summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-02-10 00:02:38 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-02-10 00:02:38 +0000
commit0f9d01d8acdb361b250ce084b0fdbd491d98f754 (patch)
treeb2c505fb22f6318438170be80c93c55b9bd1d9f9
parent67dd730546618dd99ebd48ebf2f10da493a90756 (diff)
downloadphp-git-0f9d01d8acdb361b250ce084b0fdbd491d98f754.tar.gz
Fixed bug #27026 (Added cgi.nph that allows forcing of the Status: 200
header that is not normally needed).
-rw-r--r--php.ini-dist4
-rw-r--r--php.ini-recommended4
-rw-r--r--sapi/cgi/cgi_main.c8
3 files changed, 14 insertions, 2 deletions
diff --git a/php.ini-dist b/php.ini-dist
index 76dae079b3..30e29fc685 100644
--- a/php.ini-dist
+++ b/php.ini-dist
@@ -445,6 +445,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
diff --git a/php.ini-recommended b/php.ini-recommended
index b9140e123b..b45e264206 100644
--- a/php.ini-recommended
+++ b/php.ini-recommended
@@ -464,6 +464,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
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 0580ac544c..340baeae4f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -289,7 +289,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;
@@ -303,7 +303,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) {