diff options
author | Michael Wallner <mike@php.net> | 2013-08-09 11:21:50 +0200 |
---|---|---|
committer | Michael Wallner <mike@php.net> | 2013-08-09 11:21:50 +0200 |
commit | b33824bfeaca68a6fec7b9066945fe171174c42c (patch) | |
tree | 560fffe50d6dbac907fee91e10ebe6e3a15f06d5 | |
parent | 22d7002462a142e5ecd0010a534a4242e76e6846 (diff) | |
parent | ac28283beb58b367ef1f842b5ee0d6397eb4b516 (diff) | |
download | php-git-b33824bfeaca68a6fec7b9066945fe171174c42c.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
fix bug #65391
Update NEWS
-rw-r--r-- | ext/zlib/tests/bug65391.phpt | 28 | ||||
-rw-r--r-- | ext/zlib/zlib.c | 6 |
2 files changed, 31 insertions, 3 deletions
diff --git a/ext/zlib/tests/bug65391.phpt b/ext/zlib/tests/bug65391.phpt new file mode 100644 index 0000000000..3ba5350810 --- /dev/null +++ b/ext/zlib/tests/bug65391.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #65391 (Unable to send vary header user-agent when ob_start('ob_gzhandler') is called) +--SKIPIF-- +<?php +extension_loaded("zlib") or die("skip need zlib"); +?> +--GET-- +dummy=1 +--FILE-- +<?php +header("Vary: Cookie"); +ob_start("ob_gzhandler"); + +// run-tests cannot test for a multiple Vary header +ob_flush(); +print_r(headers_list()); + +?> +Done +--EXPECTF-- +Array +( + [0] => X-Powered-By: PHP/%s + [1] => Vary: Cookie + [2] => Vary: Accept-Encoding +) +Done + diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 1a202e344e..1114bc8a65 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -190,7 +190,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o if ((output_context->op & PHP_OUTPUT_HANDLER_START) && (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) ) { - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } return FAILURE; } @@ -220,7 +220,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o deflateEnd(&ctx->Z); return FAILURE; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC); } } @@ -478,7 +478,7 @@ static PHP_FUNCTION(ob_gzhandler) 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); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); } if (!ZLIBG(ob_gzhandler)) { |