php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64433
Patch hyper-zon-a revision 2013-05-20 18:13 UTC by herman dot laubscher at gmail dot com
Patch fopen_follow_location revision 2013-03-15 16:41 UTC by akbarovs at gmail dot com

Patch fopen_follow_location for Streams related Bug #64433

Patch version 2013-03-15 16:41 UTC

Return to Bug #64433 | Download this patch
Patch Revisions:

Developer: akbarovs@gmail.com

734c734,736
< 				if (context && php_stream_context_get_option(context, "http", "follow_location", &tmpzval) == SUCCESS) {
---
> 				/* we only care about Location for 300, 301, 302, 303 and 307 */
> 				/* see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1 */
> 				if ((response_code >= 300 && response_code < 304 || 307 == response_code) && context && php_stream_context_get_option(context, "http", "follow_location", &tmpzval) == SUCCESS) {
738,742d739
< 				} else if (!(response_code >= 300 && response_code < 304 || 307 == response_code)) { 
< 					/* we shouldn't redirect automatically
< 					if follow_location isn't set and response_code not in (300, 301, 302, 303 and 307) 
< 					see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1 */
< 					follow_location = 0;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC