cvs: php-src(PHP_5_2) / NEWS /main output.c

From: Date: Mon, 29 Jan 2007 11:21:31 +0000
Subject: cvs: php-src(PHP_5_2) / NEWS /main output.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-42898@lists.php.net to get a copy of this message
dmitry Mon Jan 29 11:21:31 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main output.c /php-src NEWS Log: Fixed bug #40259 (ob_start call many times - memory error). (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.167.2.3.2.1&r2=1.167.2.3.2.2&diff_format=u Index: php-src/main/output.c diff -u php-src/main/output.c:1.167.2.3.2.1 php-src/main/output.c:1.167.2.3.2.2 --- php-src/main/output.c:1.167.2.3.2.1 Mon Jan 1 09:36:11 2007 +++ php-src/main/output.c Mon Jan 29 11:21:31 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.167.2.3.2.1 2007/01/01 09:36:11 sebastian Exp $ */ +/* $Id: output.c,v 1.167.2.3.2.2 2007/01/29 11:21:31 dmitry Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -416,9 +416,23 @@ */ static int php_ob_init_named(uint initial_size, uint block_size, char *handler_name, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC) { + php_ob_buffer tmp_buf; + if (output_handler && !zend_is_callable(output_handler, 0, NULL)) { return FAILURE; } + + tmp_buf.block_size = block_size; + tmp_buf.size = initial_size; + tmp_buf.buffer = (char *) emalloc(initial_size+1); + tmp_buf.text_length = 0; + tmp_buf.output_handler = output_handler; + tmp_buf.chunk_size = chunk_size; + tmp_buf.status = 0; + tmp_buf.internal_output_handler = NULL; + tmp_buf.handler_name = estrdup(handler_name&&handler_name[0]?handler_name:OB_DEFAULT_HANDLER_NAME); + tmp_buf.erase = erase; + if (OG(ob_nesting_level)>0) { #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) if (!strncmp(handler_name, "ob_gzhandler", sizeof("ob_gzhandler")) && php_ob_gzhandler_check(TSRMLS_C)) { @@ -431,16 +445,7 @@ zend_stack_push(&OG(ob_buffers), &OG(active_ob_buffer), sizeof(php_ob_buffer)); } OG(ob_nesting_level)++; - OG(active_ob_buffer).block_size = block_size; - OG(active_ob_buffer).size = initial_size; - OG(active_ob_buffer).buffer = (char *) emalloc(initial_size+1); - OG(active_ob_buffer).text_length = 0; - OG(active_ob_buffer).output_handler = output_handler; - OG(active_ob_buffer).chunk_size = chunk_size; - OG(active_ob_buffer).status = 0; - OG(active_ob_buffer).internal_output_handler = NULL; - OG(active_ob_buffer).handler_name = estrdup(handler_name&&handler_name[0]?handler_name:OB_DEFAULT_HANDLER_NAME); - OG(active_ob_buffer).erase = erase; + OG(active_ob_buffer) = tmp_buf; OG(php_body_write) = php_b_body_write; return SUCCESS; } http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.513&r2=1.2027.2.547.2.514&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.513 php-src/NEWS:1.2027.2.547.2.514 --- php-src/NEWS:1.2027.2.547.2.513 Fri Jan 26 15:15:16 2007 +++ php-src/NEWS Mon Jan 29 11:21:31 2007 @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2007, PHP 5.2.1 +- Fixed bug #40259 (ob_start call many times - memory error). (Dmitry) - Fixed bug #40231 (file_exists incorrectly reports false). (Dmitry) 25 Jan 2007, PHP 5.2.1RC4

« previous php.cvs (#42898) next »