From 4a7a837d936f55ee3e939d9cc695c4a9b6dc04e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 17 Jan 2017 14:44:23 +0100 Subject: [PATCH] Ensure that the output buffer is always end()ed in TemplateEngine::fetch() --- .../lib/system/template/TemplateEngine.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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) { -- 2.20.1