#38802 [Tbd->Csd]: 'max_redirects' context options doesn't work when value is 1

From: Date: Wed, 17 Feb 2010 00:35:41 +0000
Subject: #38802 [Tbd->Csd]: 'max_redirects' context options doesn't work when value is 1
References: 1  Groups: php.bugs php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3913@lists.php.net to get a copy of this message
ID: 38802 Updated by: joey@php.net Reported By: datibbaw@php.net -Status: To be documented +Status: Closed Bug Type: HTTP related Operating System: Linux Gentoo PHP Version: 5.2.9 New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2010-02-17 00:35:23] svn@php.net Automatic comment from SVN on behalf of joey Revision: http://svn.php.net/viewvc/?view=revision&revision=295190 Log: Apply user-patch from David Tajchreber, closes PHP Bug #38802 ------------------------------------------------------------------------ [2010-01-17 23:15:59] dave dot tajchreber at gmail dot com Proposed patch: http://codepad.org/DoeR65RJ David Tajchreber ------------------------------------------------------------------------ [2009-05-16 20:54:08] lbarnaud@php.net To be documented: (Tip?): use ignore_errors=1 and max_redirects=0 to never follow redirects while being able to get headers and response body. ------------------------------------------------------------------------ [2009-05-11 14:51:33] datibbaw@php.net There's a small gap of proper support here: 1) the get_headers() function would give the Location header (since it uses STREAM_ONLY_GET_HEADERS) if the max_redirects is set to 1, but it doesn't return a response body 2) the current fopen wrapper function only returns the headers (inside the wrapper data) in the absence of a Location header I was exploring to use php streams as an extension to the oauth project so that the curl dependency could be made optional, but this would require me to copy & paste a lot of logic from php_stream_url_wrap_http_ex() =( ------------------------------------------------------------------------ [2007-10-08 11:20:46] rele at gmx dot de I get the same error if I just want to download the mirror selection page: file_put_contents('xampp-win32-1.6.4.exe.html', file_get_contents('http://downloads.sourceforge.net/xampp/xampp-win32-1.6.4.exe?use_mirror=osdn', FALSE, stream_context_create(array('http'=>array('max_redirects'=>1))), 0, 10000)); ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/38802 -- Edit this bug report at http://bugs.php.net/?id=38802&edit=1

« previous php.doc.bugs (#3913) next »