bug73630a.phpt 643 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #73630 (Built-in Weberver - overwrite $_SERVER['request_uri'])
  3. --DESCRIPTION--
  4. Check that too long paths result in invalid request
  5. --SKIPIF--
  6. <?php
  7. include "skipif.inc";
  8. ?>
  9. --FILE--
  10. <?php
  11. $code = <<<'EOF'
  12. echo "won't happen\n";
  13. EOF;
  14. include "php_cli_server.inc";
  15. php_cli_server_start($code);
  16. $host = PHP_CLI_SERVER_HOSTNAME;
  17. $fp = php_cli_server_connect();
  18. $path = "/" . str_repeat("x", 16400) . "//example.com";
  19. var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "$path"));
  20. ?>
  21. --EXPECTF--
  22. Warning: file_get_contents(http://%s//example.com): Failed to open stream: HTTP request failed! in %s on line %d
  23. bool(false)