summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-04-14 11:22:38 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-04-14 11:22:38 +0200
commit12f1adb7bbdd1bfcab0df93a998909d85f650454 (patch)
treeb0b5a61e6eb14c9a8543a2dcae5aa23f5ebee2c1 /lib/private
parent54f6c05c79a1d01c32c016477c6ae2220e754b13 (diff)
downloadnextcloud-server-12f1adb7bbdd1bfcab0df93a998909d85f650454.tar.gz
nextcloud-server-12f1adb7bbdd1bfcab0df93a998909d85f650454.zip
Properly handle exception within templates
* fixes partial printed templates when exception is thrown in between
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/template/base.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/template/base.php b/lib/private/template/base.php
index 72abc38c36c..2c745b02a1d 100644
--- a/lib/private/template/base.php
+++ b/lib/private/template/base.php
@@ -168,8 +168,13 @@ class Base {
// Include
ob_start();
- include $file;
- $data = ob_get_contents();
+ try {
+ include $file;
+ $data = ob_get_contents();
+ } catch (\Exception $e) {
+ @ob_end_clean();
+ throw $e;
+ }
@ob_end_clean();
// Return data