File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
ext/standard/tests/network Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,18 @@ if (($i = count($expected)) > count($headers))
44
44
return ;
45
45
}
46
46
47
- do
48
- {
49
- if (strncmp (current ($ headers ), 'Set-Cookie: ' , 11 ) !== 0 )
50
- {
47
+ do {
48
+ $ header = current ($ headers );
49
+ if (strncmp ($ header , 'Set-Cookie: ' , 11 ) !== 0 ) {
51
50
continue ;
52
51
}
53
52
54
- if (current ($ headers ) === current ($ expected ))
55
- {
53
+ // If the second rolls over between the time() call and the internal time determination by
54
+ // setcookie(), we might get Max-Age=4 instead of Max-Age=5.
55
+ $ header = str_replace ('Max-Age=4 ' , 'Max-Age=5 ' , $ header );
56
+ if ($ header === current ($ expected )) {
56
57
$ i --;
57
- }
58
- else
59
- {
58
+ } else {
60
59
echo "Header mismatch: \n\tExpected: "
61
60
.current ($ expected )
62
61
."\n\tReceived: " .current ($ headers )."\n" ;
You can’t perform that action at this time.
0 commit comments