Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions ext/standard/tests/http/gh16810.phpt
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
--TEST--
Bug #79265 variation: "host:" not at start of header
GH-16809 (fopen HTTP wrapper timeout stream context option overflow)
--INI--
allow_url_fopen=1
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
$uri = "http://www.example.com";
$serverCode = <<<'CODE'
echo 1;
CODE;

include __DIR__."/../../../../sapi/cli/tests/php_cli_server.inc";
php_cli_server_start($serverCode, null, []);

$uri = "http://" . PHP_CLI_SERVER_ADDRESS . '/test';
$config = [
'http' => [
'timeout' => PHP_INT_MIN,
],
'http' => [
'timeout' => PHP_INT_MIN,
],
];
$ctx = stream_context_create($config);
var_dump(fopen($uri, "r", false, $ctx));
Expand All @@ -22,5 +29,5 @@ var_dump(fopen($uri, "r", false, $ctx));
--EXPECTF--
resource(%d) of type (stream)

Warning: fopen(http://www.example.com): Failed to open stream: timeout must be lower than %d in %s on line %d
Warning: fopen(http://%s): Failed to open stream: timeout must be lower than %d in %s on line %d
bool(false)
Loading