laruence                                 Tue, 01 Nov 2011 13:06:41 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=318641

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

Bug: https://bugs.php.net/60189 (Assigned) php logo can not be displayed
      
Changed paths:
    U   php/php-src/branches/PHP_5_4/NEWS
    U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
    A   php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_011.phpt
    U   php/php-src/trunk/sapi/cli/php_cli_server.c
    A   php/php-src/trunk/sapi/cli/tests/php_cli_server_011.phpt

Modified: php/php-src/branches/PHP_5_4/NEWS
===================================================================
--- php/php-src/branches/PHP_5_4/NEWS   2011-11-01 12:42:58 UTC (rev 318640)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-11-01 13:06:41 UTC (rev 318641)
@@ -10,6 +10,7 @@
   . 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

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===================================================================
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c      2011-11-01 
12:42:58 UTC (rev 318640)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c      2011-11-01 
13:06:41 UTC (rev 318641)
@@ -1931,7 +1931,7 @@
                destroy_request_info(&SG(request_info));
                return -1;
        }
-       {
+       if (!php_handle_special_queries(TSRMLS_C)) {
                zend_file_handle zfd;
                char *old_cwd;


Added: php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_011.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_011.phpt         
                (rev 0)
+++ php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_011.phpt 
2011-11-01 13:06:41 UTC (rev 318641)
@@ -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

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===================================================================
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-11-01 12:42:58 UTC (rev 
318640)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-11-01 13:06:41 UTC (rev 
318641)
@@ -1931,7 +1931,7 @@
                destroy_request_info(&SG(request_info));
                return -1;
        }
-       {
+       if (!php_handle_special_queries(TSRMLS_C)) {
                zend_file_handle zfd;
                char *old_cwd;


Added: php/php-src/trunk/sapi/cli/tests/php_cli_server_011.phpt
===================================================================
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_011.phpt                    
        (rev 0)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_011.phpt    2011-11-01 
13:06:41 UTC (rev 318641)
@@ -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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to