summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdin Kadribasic <edink@php.net>2003-06-03 10:08:17 +0000
committerEdin Kadribasic <edink@php.net>2003-06-03 10:08:17 +0000
commit4f75f3bef1a39503cd9d6076630f5aba201c2e4e (patch)
tree3a8fcd09a4025b6eb62d01041ebde343dedeacac
parent28f4501f0a3bc67b1a56f81060d71f22e1821fb4 (diff)
downloadphp-git-4f75f3bef1a39503cd9d6076630f5aba201c2e4e.tar.gz
MFH (bugfix #23902 by Shane).
-rw-r--r--main/SAPI.c6
-rw-r--r--php.ini-dist2
-rw-r--r--php.ini-recommended2
-rw-r--r--sapi/cgi/cgi_main.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index d290587184..78de141ea4 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -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;
diff --git a/php.ini-dist b/php.ini-dist
index 3e2958561e..deae088cab 100644
--- a/php.ini-dist
+++ b/php.ini-dist
@@ -463,7 +463,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
diff --git a/php.ini-recommended b/php.ini-recommended
index b801ea2551..a078ec4f73 100644
--- a/php.ini-recommended
+++ b/php.ini-recommended
@@ -478,7 +478,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
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 1722cf8583..527bddef7a 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -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);