]> granicus.if.org Git - php/commitdiff
MFH:- Fixed bug #42362 (HTTP status codes 204 and 304 should not be gzipped)
authorJani Taskinen <jani@php.net>
Tue, 26 May 2009 04:47:05 +0000 (04:47 +0000)
committerJani Taskinen <jani@php.net>
Tue, 26 May 2009 04:47:05 +0000 (04:47 +0000)
NEWS
ext/zlib/zlib.c

diff --git a/NEWS b/NEWS
index 294f573553de5d16b56c988493f53824910695f0..a4fa976357fa5c044d26447ba3484b1467782180 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -125,6 +125,8 @@ PHP                                                                        NEWS
   data). (Arnaud)
 - Fixed bug #42414 (some odbc_*() functions incompatible with Oracle ODBC 
   driver). (jhml at gmx dot net)
+- Fixed bug #42362 (HTTP status codes 204 and 304 should not be gzipped).
+  (Scott, Edward Z. Yang)
 - Fixed bug #38805 (PDO truncates text from SQL Server text data type
   field). (Steph)
 
index f30d615ecec0c15e92f8cecccac7038f31df8095..ef10b69e44a2d8f051c680dabe4b067712e944b3 100644 (file)
@@ -987,7 +987,7 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle
 {
        zend_bool do_start, do_end;
 
-       if (!ZLIBG(output_compression)) {
+       if (!ZLIBG(output_compression) || SG(sapi_headers).http_response_code == 204 || SG(sapi_headers).http_response_code == 304) {
                *handled_output = NULL;
        } else {
                do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0);