From: Tim Düsterhus Date: Tue, 17 Jan 2017 13:45:47 +0000 (+0100) Subject: Wrap background job execution in an output buffer X-Git-Tag: 3.0.1~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=36d5b1a83d9823d581f4d29c88b7b7b63bb561a3;p=GitHub%2FWoltLab%2FWCF.git Wrap background job execution in an output buffer --- diff --git a/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php b/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php index 686a613d32..c2b62efd1d 100644 --- a/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php @@ -89,6 +89,9 @@ class BackgroundQueueHandler extends SingletonFactory { try { SessionHandler::getInstance()->changeUser(new User(null), true); + if (!WCF::debugModeIsEnabled()) { + ob_start(); + } $job->perform(); } catch (\Throwable $e) { @@ -124,6 +127,9 @@ class BackgroundQueueHandler extends SingletonFactory { } } finally { + if (!WCF::debugModeIsEnabled()) { + ob_end_clean(); + } SessionHandler::getInstance()->changeUser($user, true); } }