Fixed bug #60189 (php logo can not be displayed)

This commit is contained in:
Xinchen Hui 2011-11-01 13:06:41 +00:00
parent c0402915e7
commit bba44800ae
2 changed files with 42 additions and 1 deletions

View File

@ -1931,7 +1931,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server
destroy_request_info(&SG(request_info));
return -1;
}
{
if (!php_handle_special_queries(TSRMLS_C)) {
zend_file_handle zfd;
char *old_cwd;

View File

@ -0,0 +1,41 @@
--TEST--
Bug #60180 ($_SERVER["PHP_SELF"] incorrect)
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start('sytanx error;', TRUE);
list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
$port = intval($port)?:80;
$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
if (!$fp) {
die("connect failed");
}
$logo_id = php_logo_guid();
if(fwrite($fp, <<<HEADER
GET /?={$logo_id} HTTP/1.1
Host: {$host}
HEADER
)) {
while (!feof($fp)) {
if (("Content-Type: image/gif") == trim(fgets($fp))) {
echo "okey";
break;
}
}
}
fclose($fp);
?>
--EXPECTF--
okey