]> granicus.if.org Git - php/commitdiff
Fixed OnUpdate_zlib_output_compression() behaviour
authorMoriyoshi Koizumi <moriyoshi@php.net>
Sun, 3 Nov 2002 20:31:00 +0000 (20:31 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Sun, 3 Nov 2002 20:31:00 +0000 (20:31 +0000)
ext/zlib/zlib.c

index d5f2b924ad169e16303ac700506d822d17e0e9ce..0238d2fd1ad276bd2e41da9827123c43d520e8cd 100644 (file)
@@ -135,13 +135,6 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
 {
        char *ini_value;
 
-       ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0); 
-       if (ini_value != NULL && strlen(ini_value) != 0 && 
-               new_value != NULL && strlen(new_value) != 0 ) {
-               php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
-               return FAILURE;
-       }
-
        if(new_value == NULL)
                return FAILURE;
 
@@ -153,6 +146,13 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
                new_value_length = sizeof("1");
        }
 
+       ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0); 
+       if (ini_value != NULL && strlen(ini_value) != 0 && 
+               zend_atoi(new_value, new_value_length) != 0) {
+               php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
+               return FAILURE;
+       }
+
        if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) {
                php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent");
                return FAILURE;