]> granicus.if.org Git - php/commitdiff
Fixed bug #60189 (php logo can not be displayed)
authorXinchen Hui <laruence@php.net>
Tue, 1 Nov 2011 13:06:41 +0000 (13:06 +0000)
committerXinchen Hui <laruence@php.net>
Tue, 1 Nov 2011 13:06:41 +0000 (13:06 +0000)
NEWS
sapi/cli/php_cli_server.c
sapi/cli/tests/php_cli_server_011.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 67fee7d25c263b87a1e68fbd7cd25a32583631fe..f1ee37e18d63d96dfefdd70df62ad5fd2c02ed80 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ PHP                                                                        NEWS
   . Fixed bug #60115 (memory definitely lost in cli server). (Laruence)
   . Fixed bug #60146 (Last 2 lines of page not being output). (Laruence)
   . Fixed bug #60180 ($_SERVER["PHP_SELF"] incorrect). (Laruence)
+  . Fixed bug #60189 (php logo can not be displayed). (Laruence)
 
 - Core:
   . Fixed bug #60120 (proc_open's streams may hang with stdin/out/err when 
index 67df608672525158f98e230780fa2a9e97b603a1..597efc8e6364b580d0ee37a7ff91a479a413b06f 100644 (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;
 
diff --git a/sapi/cli/tests/php_cli_server_011.phpt b/sapi/cli/tests/php_cli_server_011.phpt
new file mode 100644 (file)
index 0000000..a957a8e
--- /dev/null
@@ -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