From: epriestley Date: Sat, 16 Jul 2011 15:09:47 +0000 (-0700) Subject: Flush output buffers before running 'arc' X-Git-Tag: conduit-4~284 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=2d50e08ee6fbf8f53dbb21377d699782f6f7dcc2;p=arcanist.git 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 --- 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(); +}