From: Tim Düsterhus Date: Tue, 17 Jan 2017 13:44:23 +0000 (+0100) Subject: Ensure that the output buffer is always end()ed in TemplateEngine::fetch() X-Git-Tag: 3.0.1~26 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4a7a837d936f55ee3e939d9cc695c4a9b6dc04e0;p=GitHub%2FWoltLab%2FWCF.git Ensure that the output buffer is always end()ed in TemplateEngine::fetch() --- diff --git a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php index 6eed74bf9c..17ef91c734 100755 --- a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php @@ -541,10 +541,14 @@ class TemplateEngine extends SingletonFactory { } // get output - ob_start(); - $this->display($templateName, $application, false); - $output = ob_get_contents(); - ob_end_clean(); + try { + ob_start(); + $this->display($templateName, $application, false); + $output = ob_get_contents(); + } + finally { + ob_end_clean(); + } // disable sandbox if ($sandbox) {