xref: /PHP-7.3/sapi/cli/tests/bug70264.phpt (revision 9c805a6c)
1--TEST--
2Bug #70264 (CLI server directory traversal)
3--INI--
4allow_url_fopen=1
5--SKIPIF--
6<?php
7include "skipif.inc";
8?>
9--FILE--
10<?php
11include "php_cli_server.inc";
12php_cli_server_start(null, null);
13echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/..\\CREDITS");
14echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/..%5CCREDITS");
15?>
16--EXPECTF--
17Warning: file_get_contents(http://%s/..\CREDITS): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
18 in %sbug70264.php on line %d
19
20Warning: file_get_contents(http://%s/..%5CCREDITS): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
21 in %sbug70264.php on line %d
22