diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-12-31 19:22:17 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-12-31 19:22:17 +0000 |
| commit | e88897ec7bcd098d4994f83d0af9cbeecfdc0245 (patch) | |
| tree | 0eb2807c03c12b55e4dcb4105dfe14738c8419ac | |
| parent | f9a45d2cdbf8141646bff79c42732478f50dc0ff (diff) | |
| download | php-git-e88897ec7bcd098d4994f83d0af9cbeecfdc0245.tar.gz | |
MFB: Fixed bug #39984 (redirect response code in header() could be ignored
in CGI sapi).
| -rw-r--r-- | main/SAPI.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index 56488efdc9..8e1aa862fb 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -657,7 +657,9 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) SG(sapi_headers).http_response_code > 307) && SG(sapi_headers).http_response_code != 201) { /* Return a Found Redirect if one is not already specified */ - if(SG(request_info).proto_num > 1000 && + if (http_response_code) { /* user specified redirect code */ + sapi_update_response_code(http_response_code TSRMLS_CC); + } else if (SG(request_info).proto_num > 1000 && SG(request_info).request_method && strcmp(SG(request_info).request_method, "HEAD") && strcmp(SG(request_info).request_method, "GET")) { |
