summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-12-31 19:22:01 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-12-31 19:22:01 +0000
commit96489b417845c5ee2e36f42142c97286bd28afbd (patch)
treebeb000773a55496b5b317ddc4c1fafe747eac1e8 /main/SAPI.c
parentb8003b84612f373267fd311be1946d30b38e74d3 (diff)
downloadphp-git-96489b417845c5ee2e36f42142c97286bd28afbd.tar.gz
Fixed bug #39984 (redirect response code in header() could be ignored in
CGI sapi).
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 8abca79ed2..4c14712a19 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -631,7 +631,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")) {