dmitry Tue May 15 08:17:21 2007 UTC Modified files: /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/sapi/cgi/cgi_main.c?r1=1.320&r2=1.321&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.320 php-src/sapi/cgi/cgi_main.c:1.321 --- php-src/sapi/cgi/cgi_main.c:1.320 Tue Apr 17 20:01:22 2007 +++ php-src/sapi/cgi/cgi_main.c Tue May 15 08:17:20 2007 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.320 2007/04/17 20:01:22 sniper Exp $ */ +/* $Id: cgi_main.c,v 1.321 2007/05/15 08:17:20 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -320,7 +320,16 @@ } } else { - len = sprintf(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 = sprintf(buf, "Status:%s\r\n", s); + } else { + len = sprintf(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