php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #35555 Meaning of max_redirects = 0 in wrappers.http
Submitted: 2005-12-05 13:50 UTC Modified: 2005-12-06 15:33 UTC
From: richard dot quadling at bandvulc dot co dot uk Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: windows
Private report: No CVE-ID: None
 [2005-12-05 13:50 UTC] richard dot quadling at bandvulc dot co dot uk
Description:
------------
I have found a bug on page function.stream-context-create.html
[chm date: 2005-12-01]...

The new parameter max_redirects limits the number of redirects to 20.

It is unclear if, without this value set, or for versions of PHP which this setting is inappropriate, if redirects are followed forever or at all; 0 or infinity.

As this setting only LIMITS the redirects, it does not control whether to follow them or not, though NOT can be implemented by setting the value to 0.


I tried looking at the source (quick search in LXR first) and could find no reference to max_redirects, though I did find CURLOPT_MAXREDIRS in the CURL extension. I did a search on request_fulluri (the setting immediately before max_redirects in the manual) and this was found in http_fopen_wrapper.c

I then did a check for php_stream_context_get_option and none of the finds related to the HTTP protocol with the max_redirects option and considering this is now settable by a user, I was expecting this to be the case.

From what I can tell, the 20 is hard-coded and cannot be altered by setting max_redicts in the context.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-05 21:48 UTC] pollita@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


No such text appears on this page.  Did you see it in a  (now absent) user contributed note perhaps?
 [2005-12-06 13:55 UTC] richard dot quadling at bandvulc dot co dot uk
WTF? Wrong page.

http://uk.php.net/manual/en/wrappers.http.php

Sorry. Sorry. Sorry.
 [2005-12-06 15:33 UTC] vrana@php.net
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.

"Value 1 or less means that no redirects are followed."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 15:00:02 2025 UTC