summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2013-08-20 09:06:13 +0200
committerOndřej Surý <ondrej@sury.org>2013-08-20 09:06:13 +0200
commitbf4af35254bfff38b18848b86bb2bf7cf11085de (patch)
tree4357e214a9bbaea82dc6bd318cf2ddaa4c7ba01c /ext/zlib
parentd837b4550418036e76d6adb3c7dad94b1e3a5a6a (diff)
downloadphp-bf4af35254bfff38b18848b86bb2bf7cf11085de.tar.gz
New upstream version 5.5.2+dfsgupstream/5.5.2+dfsg
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/config0.m42
-rw-r--r--ext/zlib/tests/bug65391.phpt28
-rw-r--r--ext/zlib/zlib.c6
3 files changed, 32 insertions, 4 deletions
diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4
index 25c7f4f42..ebf67cc00 100644
--- a/ext/zlib/config0.m4
+++ b/ext/zlib/config0.m4
@@ -3,7 +3,7 @@ dnl $Id$
dnl
PHP_ARG_WITH(zlib,for ZLIB support,
-[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)])
+[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)])
PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined,
[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no)
diff --git a/ext/zlib/tests/bug65391.phpt b/ext/zlib/tests/bug65391.phpt
new file mode 100644
index 000000000..3ba535081
--- /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 1a202e344..1114bc8a6 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)) {