php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #76208
Patch yaf_response_http.patch revision 2018-04-11 12:05 UTC by fanjiapeng at 126 dot com
revision 2018-04-11 12:00 UTC by fanjiapeng at 126 dot com

Patch yaf_response_http.patch for yaf Bug #76208

Patch version 2018-04-11 12:05 UTC

Return to Bug #76208 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: fanjiapeng@126.com

diff --git a/responses/yaf_response_http.c b/responses/yaf_response_http.c
index d277773..fb6dc79 100644
--- a/responses/yaf_response_http.c
+++ b/responses/yaf_response_http.c
@@ -136,6 +136,10 @@ int yaf_response_alter_header(yaf_response_t *response, zend_string *name, char
 int yaf_response_set_redirect(yaf_response_t *response, char *url, int len) {
 	sapi_header_line ctr = {0};
 
+	if (UNEXPECTED(!(SG(request_info).request_method))) {
+	   return 0;
+	}
+
 	ctr.line_len    = spprintf(&(ctr.line), 0, "%s %s", "Location:", url);
 	ctr.response_code   = 0;
 	if (sapi_header_op(SAPI_HEADER_REPLACE, &ctr) == SUCCESS) {
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Aug 24 22:01:26 2019 UTC