diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2002-10-03 03:58:12 +0000 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2002-10-03 03:58:12 +0000 |
commit | 22bf29384e000df1331cdaa9069133e09c989405 (patch) | |
tree | 5050b1b147a8c766da57463e0cd59182336e95e3 /ext/zlib/zlib.c | |
parent | b9077e5a9de74faab97c1f671fed0934537a7b2b (diff) | |
download | php-git-22bf29384e000df1331cdaa9069133e09c989405.tar.gz |
Move wrong output buffer usage check to ob_gzhandler init.
Export some output buffer functions.
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r-- | ext/zlib/zlib.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index fb2e6ce55e..d5f2b924ad 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -905,6 +905,24 @@ PHP_FUNCTION(ob_gzhandler) ZEND_WRONG_PARAM_COUNT(); } + /* check for wrong usages */ + if (OG(ob_nesting_level>1)) { + if (php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used twice"); + RETURN_FALSE; + } + if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'mb_output_handler'"); + RETURN_FALSE; + } + if (php_ob_handler_used("URL-Rewriter" TSRMLS_CC)) { + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter'"); + RETURN_FALSE; + } + if (php_ob_init_conflict("ob_gzhandler", "zlib output compression" TSRMLS_CC)) + RETURN_FALSE; + } + if (ZLIBG(ob_gzhandler_status)==-1 || zend_hash_find(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), (void **) &data)==FAILURE || Z_TYPE_PP(data)!=IS_ARRAY |