cvs: php4(PHP_4_2_0) /ext/zlib zlib.c /main output.c

From: Date: Fri, 23 Aug 2002 08:36:28 +0000
Subject: cvs: php4(PHP_4_2_0) /ext/zlib zlib.c /main output.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13589@lists.php.net to get a copy of this message
zeev Fri Aug 23 04:36:28 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/zlib zlib.c /php4/main output.c Log: Fix ob_gzhandler()'s handling of requests without compression, but that do have an Accept-Encoding header Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.106.2.2 php4/ext/zlib/zlib.c:1.106.2.3 --- php4/ext/zlib/zlib.c:1.106.2.2 Wed Mar 13 15:49:45 2002 +++ php4/ext/zlib/zlib.c Fri Aug 23 04:36:27 2002 @@ -18,7 +18,7 @@ | Jade Nicoletti <nicoletti@nns.ch> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.106.2.2 2002/03/13 20:49:45 sr Exp $ */ +/* $Id: zlib.c,v 1.106.2.3 2002/08/23 08:36:27 zeev Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -1247,11 +1247,8 @@ || zend_hash_find(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), (void **) &data)==FAILURE || Z_TYPE_PP(data)!=IS_ARRAY || zend_hash_find(Z_ARRVAL_PP(data), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding)==FAILURE) { - /* return the original string */ - *return_value = **zv_string; - zval_copy_ctor(return_value); ZLIBG(ob_gzhandler_status)=-1; - return; + RETURN_FALSE; } convert_to_string_ex(a_encoding); if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { @@ -1259,6 +1256,7 @@ } else if(php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { coding = CODING_DEFLATE; } else { + ZLIBG(ob_gzhandler_status)=-1; RETURN_FALSE; } Index: php4/main/output.c diff -u php4/main/output.c:1.88.2.1 php4/main/output.c:1.88.2.2 --- php4/main/output.c:1.88.2.1 Wed Apr 24 12:58:59 2002 +++ php4/main/output.c Fri Aug 23 04:36:28 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.88.2.1 2002/04/24 16:58:59 stas Exp $ */ +/* $Id: output.c,v 1.88.2.2 2002/08/23 08:36:28 zeev Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -175,9 +175,11 @@ params[1] = &z_status; OG(ob_lock) = 1; if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler, &alternate_buffer, 2, params, 1, NULL TSRMLS_CC)==SUCCESS) { - convert_to_string_ex(&alternate_buffer); - final_buffer = Z_STRVAL_P(alternate_buffer); - final_buffer_length = Z_STRLEN_P(alternate_buffer); + if (!(Z_TYPE_P(alternate_buffer)==IS_BOOL && Z_BVAL_P(alternate_buffer)==0)) { + convert_to_string_ex(&alternate_buffer); + final_buffer = Z_STRVAL_P(alternate_buffer); + final_buffer_length = Z_STRLEN_P(alternate_buffer); + } } OG(ob_lock) = 0; zval_ptr_dtor(&OG(active_ob_buffer).output_handler);

« previous php.cvs (#13589) next »