diff options
author | Mario <mario@mariovavti.com> | 2018-09-17 11:03:37 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-09-17 11:03:37 +0200 |
commit | eefa47776b90e1d91140633f73fbbddb973db0b4 (patch) | |
tree | 5361fa89c4dd54f9ea063113f88e78a58f4c56a4 /include | |
parent | 0b12a7e66fc8f9489fcbf1c108f61e5ac6283605 (diff) | |
parent | 8ad24ca3e8919060cf650f526ddce155f1b3bb77 (diff) | |
download | volse-hubzilla-eefa47776b90e1d91140633f73fbbddb973db0b4.tar.gz volse-hubzilla-eefa47776b90e1d91140633f73fbbddb973db0b4.tar.bz2 volse-hubzilla-eefa47776b90e1d91140633f73fbbddb973db0b4.zip |
Merge branch 'trap-template-errors' into 'dev'
Trap errors in template rendering. Output a generic error and log problem.
See merge request hubzilla/core!1274
Diffstat (limited to 'include')
-rw-r--r-- | include/text.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php index 8a07dc113..4b5442985 100644 --- a/include/text.php +++ b/include/text.php @@ -37,7 +37,13 @@ function replace_macros($s, $r) { call_hooks('replace_macros', $arr); $t = App::template_engine(); - $output = $t->replace_macros($arr['template'], $arr['params']); + + try { + $output = $t->replace_macros($arr['template'], $arr['params']); + } catch (Exception $e) { + logger("Unable to render template: ",$e->getMessage()); + $output = "<h3>ERROR: there was an error creating the output.</h3>"; + } return $output; } |