cvs: php-src /main SAPI.c
| From: | Ilia Alshanetsky | Date: | Sun, 31 Dec 2006 19:22:18 +0000 |
| Subject: | cvs: php-src /main SAPI.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-42498@lists.php.net to get a copy of this message | ||
iliaa Sun Dec 31 19:22:18 2006 UTC
Modified files:
/php-src/main SAPI.c
Log:
MFB: Fixed bug #39984 (redirect response code in header() could be ignored
in CGI sapi).
http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.219&r2=1.220&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.219 php-src/main/SAPI.c:1.220
--- php-src/main/SAPI.c:1.219 Thu Dec 21 21:49:13 2006
+++ php-src/main/SAPI.c Sun Dec 31 19:22:17 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.219 2006/12/21 21:49:13 tony2001 Exp $ */
+/* $Id: SAPI.c,v 1.220 2006/12/31 19:22:17 iliaa Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -657,7 +657,9 @@
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")) {