php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch workaround-vary-header-revert for Zlib related Bug #51269

Patch version 2010-03-11 01:18 UTC

Return to Bug #51269 | Download this patch
Patch Revisions:

Developer: rcumming@ea.com

--- php-5.3.2/ext/zlib/zlib.c	2010-01-03 01:23:27.000000000 -0800
+++ php-5.3.2-fixed/ext/zlib/zlib.c	2010-03-10 16:13:04.000000000 -0800
@@ -1046,25 +1046,6 @@
 		do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0);
 		do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0);
 
-		if (do_start) {
-			if (!SG(headers_sent) && !SG(request_info).no_headers) {
-				switch (ZLIBG(compression_coding)) {
-					case CODING_GZIP:
-						sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1 TSRMLS_CC);
-						break;
-					case CODING_DEFLATE:
-						sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
-						break;
-				}
-				sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC);
-			} else {
-				/* Disable compression if headers can not be set (Fix for bug #49816) */
-				ZLIBG(output_compression) = 0;
-				*handled_output = NULL;
-				return;
-			}
-		}
-
 		if (php_deflate_string(output, output_len, handled_output, handled_output_len, do_start, do_end TSRMLS_CC) != SUCCESS) {
 			zend_error(E_ERROR, "Compression failed");
 		}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 14:01:29 2024 UTC