From 2d50e08ee6fbf8f53dbb21377d699782f6f7dcc2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 16 Jul 2011 08:09:47 -0700 Subject: [PATCH] Flush output buffers before running 'arc' Summary: See D589. Some environments configure output buffering with a prepend script. This is rather silly, but we can at least recover from it. Test Plan: Started multiple output buffers with ob_start() and then used phutil_console_confirm() to create a prompt. Verified that 'arc' was broken under output buffering prior to the patch, but now works correctly. Reviewed By: dreuss --- scripts/__init_script__.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/__init_script__.php b/scripts/__init_script__.php index 7ebd0c28..58705205 100644 --- a/scripts/__init_script__.php +++ b/scripts/__init_script__.php @@ -26,3 +26,9 @@ if (!@constant('__LIBPHUTIL__')) { } phutil_load_library(dirname(__FILE__).'/../src/'); + +// There may be some kind of auto-prepend script configured which starts an +// output buffer. Discard any such output buffers. +while (ob_get_level() > 0) { + ob_end_clean(); +} -- 2.43.0