]> granicus.if.org Git - php/commitdiff
fix bug #61443
authorMichael Wallner <mike@php.net>
Tue, 24 Apr 2012 18:35:49 +0000 (20:35 +0200)
committerMichael Wallner <mike@php.net>
Tue, 24 Apr 2012 18:35:49 +0000 (20:35 +0200)
Since upgrade to PHP 5.4, we can't change zlib.output_compression on the
fly

the check for PHP_OUTPUT_WRITTEN was over-zealous

ext/zlib/tests/bug61443.phpt [new file with mode: 0644]
ext/zlib/zlib.c

diff --git a/ext/zlib/tests/bug61443.phpt b/ext/zlib/tests/bug61443.phpt
new file mode 100644 (file)
index 0000000..ea2fa68
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+bug #61443
+--SKIPIF--
+<?php
+extension_loaded("zlib") or die("skip");
+?>
+--FILE--
+<?php
+ob_start(); echo "foo\n"; ob_get_clean(); 
+if(!headers_sent()) ini_set('zlib.output_compression', true); echo "end\n";
+?>
+DONE
+--EXPECTF--
+end
+DONE
index 545979dc9cf60a63ee286237d2d498179fccca38..f157821bf58875c3039cfc7f48741f6a86bb0937 100644 (file)
@@ -884,9 +884,6 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
                if (status & PHP_OUTPUT_SENT) {
                        php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent");
                        return FAILURE;
-               } else if ((status & PHP_OUTPUT_WRITTEN) && int_value) {
-                       php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot enable zlib.output_compression - there has already been output");
-                       return FAILURE;
                }
        }