From 44cc8153cdfedda1d0733655bc13e5e9beac3431 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 22 May 2011 07:16:40 -0400 Subject: [ticket/10191] Use ob_get_level in exit_handler for output buffering check. Calling flush() when output buffering is enabled causes output to be duplicated. Besides phpBB enabling output buffering for gzip compression, output buffering may be enabled externally to phpBB via output_handler or output_buffering directives in php.ini. Use ob_get_level to determine whether output buffering is active and call ob_flush in that case. PHPBB3-10191 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ceaf426850..22373f6d63 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4719,7 +4719,7 @@ function exit_handler() } // As a pre-caution... some setups display a blank page if the flush() is not there. - (empty($config['gzip_compress'])) ? @flush() : @ob_flush(); + (ob_get_level() > 0) ? @ob_flush() : @flush(); exit; } -- cgit v1.2.1