]> 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)
sapi/cli/php_cli_server.c
sapi/cli/tests/php_cli_server_011.phpt [new file with mode: 0644]

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