tony2001 Wed Aug 30 22:52:18 2006 UTC Modified files: /php-src/ext/tidy tidy.c Log: fix tidy problems caused by returning local static buffers looks like somebody forgot to MFB this patch.. http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.94&r2=1.95&diff_format=u Index: php-src/ext/tidy/tidy.c diff -u php-src/ext/tidy/tidy.c:1.94 php-src/ext/tidy/tidy.c:1.95 --- php-src/ext/tidy/tidy.c:1.94 Wed Aug 30 22:32:35 2006 +++ php-src/ext/tidy/tidy.c Wed Aug 30 22:52:18 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tidy.c,v 1.94 2006/08/30 22:32:35 tony2001 Exp $ */ +/* $Id: tidy.c,v 1.95 2006/08/30 22:52:18 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -490,7 +490,8 @@ tidySaveBuffer (doc, &output); FIX_BUFFER(&output); - RETVAL_STRINGL((char *) output.bp, output.size-1, 0); + RETVAL_STRINGL((char *) output.bp, output.size-1, 1); + tidyBufFree(&output); } else { RETVAL_FALSE; } @@ -661,7 +662,8 @@ case IS_STRING: obj = (PHPTidyObj *)zend_object_store_get_object(in TSRMLS_CC); tidySaveBuffer (obj->ptdoc->doc, &output); - ZVAL_STRINGL(out, (char *) output.bp, output.size, 0); + ZVAL_STRINGL(out, (char *) output.bp, output.size, 1); + tidyBufFree(&output); break; default: @@ -712,10 +714,12 @@ if (output.size) { MAKE_STD_ZVAL(temp); - ZVAL_STRINGL(temp, (char *) output.bp, output.size, 0); + ZVAL_STRINGL(temp, (char *) output.bp, output.size, 1); zend_hash_update(obj->std.properties, "value", sizeof("value"), (void *)&temp, sizeof(zval *), NULL); } + tidyBufFree(&output); + if (obj->ptdoc->errbuf->size) { MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, (char *) obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, TRUE); @@ -987,7 +991,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Tidy support", "enabled"); php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate()); - php_info_print_table_row(2, "Extension Version", PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.94 2006/08/30 22:32:35 tony2001 Exp $)"); + php_info_print_table_row(2, "Extension Version", PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.95 2006/08/30 22:52:18 tony2001 Exp $)"); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -1035,7 +1039,8 @@ tidySaveBuffer(doc, &output); FIX_BUFFER(&output); - RETVAL_STRINGL((char *) output.bp, output.size-1, 0); + RETVAL_STRINGL((char *) output.bp, output.size-1, 1); + tidyBufFree(&output); } } else { RETVAL_NULL(); @@ -1098,7 +1103,8 @@ tidySaveBuffer(obj->ptdoc->doc, &output); FIX_BUFFER(&output); - RETVAL_STRINGL((char *) output.bp, output.size-1, 0); + RETVAL_STRINGL((char *) output.bp, output.size-1, 1); + tidyBufFree(&output); } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php