dmitry          Tue May 15 08:17:08 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/sapi/cgi   cgi_main.c 
  Log:
  Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in  
"Status:" header)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.703&r2=1.2027.2.547.2.704&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.703 php-src/NEWS:1.2027.2.547.2.704
--- php-src/NEWS:1.2027.2.547.2.703     Mon May 14 18:54:05 2007
+++ php-src/NEWS        Tue May 15 08:17:08 2007
@@ -10,6 +10,8 @@
 - Fixed altering $this via argument named "this". (Dmitry)
 - Fixed PHP CLI to use the php.ini from the binary location. (Hannes)
 - Fixed segfault in strripos(). (Tony, Joxean Koret)
+- Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in 
+  "Status:" header). (Dmitry)
 - Fixed bug #41374 (wholetext concats values of wrong nodes). (Rob)
 - Fixed bug #41353 (crash in openssl_pkcs12_read() on invalid input). (Ilia)
 - Fixed bug #41351 (Invalid opcode with foreach ($a[] as $b)). (Dmitry, Tony)
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.36&r2=1.267.2.15.2.37&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.36 
php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.37
--- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.36 Tue Apr 17 20:00:53 2007
+++ php-src/sapi/cgi/cgi_main.c Tue May 15 08:17:08 2007
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.15.2.36 2007/04/17 20:00:53 sniper Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.37 2007/05/15 08:17:08 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -331,7 +331,16 @@
                        }
 
                } else {
-                       len = slprintf(buf, sizeof(buf), "Status: %d\r\n", 
SG(sapi_headers).http_response_code);
+                       char *s;
+
+                       if (SG(sapi_headers).http_status_line &&
+                           (s = strchr(SG(sapi_headers).http_status_line, ' 
')) != 0 &&
+                           (s - SG(sapi_headers).http_status_line) >= 5 &&
+                           strncasecmp(SG(sapi_headers).http_status_line, 
"HTTP/", 5) == 0) {
+                               len = slprintf(buf, sizeof(buf), 
"Status:%s\r\n", s);
+                       } else {
+                               len = slprintf(buf, sizeof(buf), "Status: 
%d\r\n", SG(sapi_headers).http_response_code);
+                       }
                }
 
                PHPWRITE_H(buf, len);

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

Reply via email to