Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ext/tidy/tests/bug77594.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Bug #77594 (ob_tidyhandler is never reset)
--DESCRIPTION--
Test is useful only with --repeat 2 (or more)
--SKIPIF--
<?php
if (!extension_loaded('tidy')) die('skip tidy extension not available');
?>
--FILE--
<?php
ob_start('ob_tidyhandler');
var_dump(ob_end_clean());
?>
--EXPECT--
bool(true)
10 changes: 9 additions & 1 deletion ext/tidy/tidy.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ static int php_tidy_output_handler(void **nothing, php_output_context *output_co
static PHP_MINIT_FUNCTION(tidy);
static PHP_MSHUTDOWN_FUNCTION(tidy);
static PHP_RINIT_FUNCTION(tidy);
static PHP_RSHUTDOWN_FUNCTION(tidy);
static PHP_MINFO_FUNCTION(tidy);

static PHP_FUNCTION(tidy_getopt);
Expand Down Expand Up @@ -500,7 +501,7 @@ zend_module_entry tidy_module_entry = {
PHP_MINIT(tidy),
PHP_MSHUTDOWN(tidy),
PHP_RINIT(tidy),
NULL,
PHP_RSHUTDOWN(tidy),
PHP_MINFO(tidy),
PHP_TIDY_VERSION,
PHP_MODULE_GLOBALS(tidy),
Expand Down Expand Up @@ -1106,6 +1107,13 @@ static PHP_RINIT_FUNCTION(tidy)
return SUCCESS;
}

static PHP_RSHUTDOWN_FUNCTION(tidy)
{
TG(clean_output) = INI_ORIG_BOOL("tidy.clean_output");

return SUCCESS;
}

static PHP_MSHUTDOWN_FUNCTION(tidy)
{
UNREGISTER_INI_ENTRIES();
Expand Down