bug70264.phpt 667 B

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