From 9b62500a1068fd9c17409e435b53a33bb1cf6838 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 22 May 2011 06:48:59 -0400 Subject: [PATCH] [ticket/10188] Use ob_get_level in msg_handler for output buffering check. Output buffering may be enabled via various approaches, among them: * output_buffering in php.ini; * output_handler in php.ini enables output_buffering; * ob_start call. ob_get_level allows us to query php runtime for the actual output buffering status. PHPBB3-10188 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ceaf426850..9f1d39118a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3743,7 +3743,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) { // flush the content, else we get a white page if output buffering is on - if ((int) @ini_get('output_buffering') === 1 || strtolower(@ini_get('output_buffering')) === 'on') + if (ob_get_level() > 0) { @ob_flush(); }