summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-10-27 05:22:19 +0000
committerfoobar <sniper@php.net>2001-10-27 05:22:19 +0000
commit609271e651c237e343529f5d3635c3afad2e4f88 (patch)
tree431d66f2b0700fe037cf68af5f76c0e219eaff85 /ext/zlib/zlib.c
parent2890b57e469fa7940eb12245cd2c7bab2f52077a (diff)
downloadphp-git-609271e651c237e343529f5d3635c3afad2e4f88.tar.gz
- Prevent PHP from starting if output_handler is set and
zlib.output_compression is on - Added notes to the bundled php.ini files about this.
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 57fe6cf711..941d9f0da5 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -131,8 +131,27 @@ ZEND_DECLARE_MODULE_GLOBALS(zlib)
ZEND_GET_MODULE(php_zlib)
#endif
+/* {{{ OnUpdate_zlib_output_compression */
+static PHP_INI_MH(OnUpdate_zlib_output_compression)
+{
+ char *ini_value;
+
+ ini_value = php_ini_string("output_handler", sizeof("output_handler"), 0);
+
+ if (new_value != NULL && strlen(ini_value) != 0) {
+ php_error(E_CORE_ERROR,"Cannot use both zlib.output_compression and output_handler!!");
+ return FAILURE;
+ }
+
+ OnUpdateInt(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+
+ return SUCCESS;
+}
+/* }}} */
+
+
PHP_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdateInt, output_compression, zend_zlib_globals, zlib_globals)
+ STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals)
PHP_INI_END()
/* {{{ phpi_destructor_gzclose