Test: /ext/standard/tests/http/bug38802.phpt - Version 7.0.12-dev        

Bug #38802 'max_redirects' context options doesn't work when value is 1
Submitted: 2006-09-13 07:36:04 Modified: 2010-02-17 00:35:40
From: datibbaw Assigned:
Status: Closed Package: HTTP related
PHP Version: 5.2.9 OS: Linux Gentoo

There is 1 diff reported by users for this test.

Count Diff
2 (100%)
020+ string(0) ""
021+ -- Test: fail after 2 redirections --
022+
023+ Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s/bug38802.php on line 17
024+ bool(false)
025+ string(0) ""
026+ -- Test: fail at first redirection --
027+
028+ Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s/bug38802.php on line 17
029+ bool(false)
030+ string(0) ""
031+ -- Test: fail at first redirection (2) --
020- string(%d) "GET /foo/bar HTTP/1.0
021- Host: 127.0.0.1:12342
022- Connection: close
024- GET /foo/bar2 HTTP/1.0
025- Host: 127.0.0.1:12342
026- Connection: close
027-
028- GET /foo/bar3 HTTP/1.0
029- Host: 127.0.0.1:12342
030- Connection: close
031-
032- GET /foo/bar4 HTTP/1.0
033- Host: 127.0.0.1:12342
034- Connection: close
035-
036- "
037- -- Test: fail after 2 redirections --
038-
039- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
040- bool(false)
041- string(%d) "GET /foo/bar HTTP/1.0
042- Host: 127.0.0.1:12342
043- Connection: close
044-
045- GET /foo/bar2 HTTP/1.0
046- Host: 127.0.0.1:12342
047- Connection: close
048-
049- "
050- -- Test: fail at first redirection --
051-
052- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
053- bool(false)
054- string(%d) "GET /foo/bar HTTP/1.0
055- Host: 127.0.0.1:12342
056- Connection: close
057-
058- "
059- -- Test: fail at first redirection (2) --
060-
033+ Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s/bug38802.php on line 17
034+ bool(false)
035+ string(0) ""
036+ -- Test: return at first redirection --
037+ resource(29) of type (stream)
038+ array(2) {
039+ [0]=>
040+ string(30) "HTTP/1.0 302 Moved Temporarily"
041+ [1]=>
042+ string(41) "Location: http://127.0.0.1:12342/foo/bar2"
043+ }
044+ string(1) "1"
045+ string(0) ""
046+ -- Test: return at first redirection (2) --
047+ resource(33) of type (stream)
048+ array(2) {
049+ [0]=>
050+ string(30) "HTTP/1.0 302 Moved Temporarily"
051+ [1]=>
052+ string(41) "Location: http://127.0.0.1:12342/foo/bar2"
053+ }
054+ string(1) "1"
055+ string(0) ""
056+ -- Test: return at second redirection --
057+ resource(38) of type (stream)
058+ array(4) {
059+ [0]=>
060+ string(30) "HTTP/1.0 302 Moved Temporarily"
061+ [1]=>
062+ string(41) "Location: http://127.0.0.1:12342/foo/bar2"
063+ [2]=>
064+ string(30) "HTTP/1.0 301 Moved Permanently"
065+ [3]=>
066+ string(41) "Location: http://127.0.0.1:12342/foo/bar3"
067+ }
068+ string(0) ""
069+ string(0) ""
061- Warning: fopen(http://127.0.0.1:12342/foo/bar): failed to open stream: Redirection limit reached, aborting in %s
062- bool(false)
063- string(%d) "GET /foo/bar HTTP/1.0
064- Host: 127.0.0.1:12342
065- Connection: close
066-
067- "
068- -- Test: return at first redirection --
069- resource(%d) of type (stream)
070- array(2) {
071- [0]=>
072- string(30) "HTTP/1.0 302 Moved Temporarily"
073- [1]=>
074- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
075- }
076- string(1) "1"
077- string(%d) "GET /foo/bar HTTP/1.0
078- Host: 127.0.0.1:12342
079- Connection: close
080-
081- "
082- -- Test: return at first redirection (2) --
083- resource(%d) of type (stream)
084- array(2) {
085- [0]=>
086- string(30) "HTTP/1.0 302 Moved Temporarily"
087- [1]=>
088- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
089- }
090- string(1) "1"
091- string(%d) "GET /foo/bar HTTP/1.0
092- Host: 127.0.0.1:12342
093- Connection: close
094-
095- "
096- -- Test: return at second redirection --
097- resource(%d) of type (stream)
098- array(4) {
099- [0]=>
100- string(30) "HTTP/1.0 302 Moved Temporarily"
101- [1]=>
102- string(41) "Location: http://127.0.0.1:12342/foo/bar2"
103- [2]=>
104- string(30) "HTTP/1.0 301 Moved Permanently"
105- [3]=>
106- string(41) "Location: http://127.0.0.1:12342/foo/bar3"
107- }
108- string(0) ""
109- string(%d) "GET /foo/bar HTTP/1.0
110- Host: 127.0.0.1:12342
111- Connection: close
112-
113- GET /foo/bar2 HTTP/1.0
114- Host: 127.0.0.1:12342
115- Connection: close
116-
117- "