Skip to content

Commit a6f1533

Browse files
committed
Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression)
1 parent a2a1cef commit a6f1533

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ PHP NEWS
3939
. Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build).
4040
(Laruence)
4141

42+
- Zlib:
43+
. Fixed bug #55544 (ob_gzhandler always conflicts with
44+
zlib.output_compression). (Laruence)
45+
4246
?? ??? 2012, PHP 5.4.5
4347

4448
- Core:

ext/zlib/php_zlib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
5252
int compression_coding;
5353
long output_compression;
5454
long output_compression_level;
55+
long output_compression_default;
5556
char *output_handler;
5657
php_zlib_context *ob_gzhandler;
5758
ZEND_END_MODULE_GLOBALS(zlib);

ext/zlib/zlib.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
890890

891891
status = OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
892892

893+
ZLIBG(output_compression) = ZLIBG(output_compression_default);
893894
if (stage == PHP_INI_STAGE_RUNTIME && int_value) {
894895
if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) {
895896
php_zlib_output_compression_start(TSRMLS_C);
@@ -914,7 +915,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_handler)
914915

915916
/* {{{ INI */
916917
PHP_INI_BEGIN()
917-
STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals)
918+
STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression_default, zend_zlib_globals, zlib_globals)
918919
STD_PHP_INI_ENTRY("zlib.output_compression_level", "-1", PHP_INI_ALL, OnUpdateLong, output_compression_level, zend_zlib_globals, zlib_globals)
919920
STD_PHP_INI_ENTRY("zlib.output_handler", "", PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals)
920921
PHP_INI_END()
@@ -958,6 +959,7 @@ static PHP_MSHUTDOWN_FUNCTION(zlib)
958959
static PHP_RINIT_FUNCTION(zlib)
959960
{
960961
ZLIBG(compression_coding) = 0;
962+
ZLIBG(output_compression) = ZLIBG(output_compression_default);
961963

962964
php_zlib_output_compression_start(TSRMLS_C);
963965

0 commit comments

Comments
 (0)