Skip to content

Commit ceac9dc

Browse files
committed
Fixed bug #60189 (php logo can not be displayed)
1 parent ac789e0 commit ceac9dc

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PHP NEWS
1010
. Fixed bug #60115 (memory definitely lost in cli server). (Laruence)
1111
. Fixed bug #60146 (Last 2 lines of page not being output). (Laruence)
1212
. Fixed bug #60180 ($_SERVER["PHP_SELF"] incorrect). (Laruence)
13+
. Fixed bug #60189 (php logo can not be displayed). (Laruence)
1314

1415
- Core:
1516
. Fixed bug #60120 (proc_open's streams may hang with stdin/out/err when

sapi/cli/php_cli_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server
19311931
destroy_request_info(&SG(request_info));
19321932
return -1;
19331933
}
1934-
{
1934+
if (!php_handle_special_queries(TSRMLS_C)) {
19351935
zend_file_handle zfd;
19361936
char *old_cwd;
19371937

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
--TEST--
2+
Bug #60180 ($_SERVER["PHP_SELF"] incorrect)
3+
--SKIPIF--
4+
<?php
5+
include "skipif.inc";
6+
?>
7+
--FILE--
8+
<?php
9+
include "php_cli_server.inc";
10+
php_cli_server_start('sytanx error;', TRUE);
11+
12+
list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
13+
$port = intval($port)?:80;
14+
15+
$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
16+
if (!$fp) {
17+
die("connect failed");
18+
}
19+
20+
$logo_id = php_logo_guid();
21+
22+
if(fwrite($fp, <<<HEADER
23+
GET /?={$logo_id} HTTP/1.1
24+
Host: {$host}
25+
26+
27+
HEADER
28+
)) {
29+
while (!feof($fp)) {
30+
if (("Content-Type: image/gif") == trim(fgets($fp))) {
31+
echo "okey";
32+
break;
33+
}
34+
}
35+
}
36+
37+
fclose($fp);
38+
39+
?>
40+
--EXPECTF--
41+
okey

0 commit comments

Comments
 (0)