From: Jani Taskinen Date: Tue, 26 May 2009 04:47:05 +0000 (+0000) Subject: MFH:- Fixed bug #42362 (HTTP status codes 204 and 304 should not be gzipped) X-Git-Tag: php-5.2.10RC1~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6abaea16ef254d4cc8487ae8af26464ec5f1d780;p=php MFH:- Fixed bug #42362 (HTTP status codes 204 and 304 should not be gzipped) --- diff --git a/NEWS b/NEWS index 294f573553..a4fa976357 100644 --- 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) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index f30d615ece..ef10b69e44 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -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);