Ensure that the output buffer is always end()ed in TemplateEngine::fetch()
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 17 Jan 2017 13:44:23 +0000 (14:44 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 17 Jan 2017 13:46:14 +0000 (14:46 +0100)
wcfsetup/install/files/lib/system/template/TemplateEngine.class.php

index 6eed74bf9cfb32a91ac7085d09900c90c741189f..17ef91c7343cf62c3aefc5e241b164100989058c 100755 (executable)
@@ -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) {