cvs: php4 /main SAPI.c
| From: | Jason Greene | Date: | Wed, 29 Nov 2000 01:22:49 +0000 |
| Subject: | cvs: php4 /main SAPI.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2816@lists.php.net to get a copy of this message | ||
jason Tue Nov 28 17:22:49 2000 EDT
Modified files:
/php4/main SAPI.c
Log:
Added the capability to specify a different HTTP Redirection response code
before the Location Header.
Ex. header("HTTP/1.1 307 Temporary Redirect");
header("Location: URL");
Index: php4/main/SAPI.c
diff -u php4/main/SAPI.c:1.97 php4/main/SAPI.c:1.98
--- php4/main/SAPI.c:1.97 Mon Nov 13 10:54:37 2000
+++ php4/main/SAPI.c Tue Nov 28 17:22:49 2000
@@ -426,7 +426,11 @@
efree(mimetype);
SG(sapi_headers).send_default_content_type = 0;
} else if (!STRCASECMP(header_line, "Location")) {
- SG(sapi_headers).http_response_code = 302; /* redirect */
+ if (SG(sapi_headers).http_response_code < 300 ||
+ SG(sapi_headers).http_response_code > 307) {
+ /* Return a Found Redirect if one is not already specified */
+ SG(sapi_headers).http_response_code = 302;
+ }
} else if (!STRCASECMP(header_line, "WWW-Authenticate")) { /* HTTP Authentication */
SG(sapi_headers).http_response_code = 401; /* authentication-required */
}