aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM.Dent <dentm42@dm42.net>2018-09-14 17:35:12 -0400
committerM.Dent <dentm42@dm42.net>2018-09-14 17:53:28 -0400
commit8ad24ca3e8919060cf650f526ddce155f1b3bb77 (patch)
treebe46853ebbc7b6eff39b921b1d81ab0c0a19999d
parent677ad71b96640a76b6e857d9e3e509d70ad7a9ce (diff)
downloadvolse-hubzilla-8ad24ca3e8919060cf650f526ddce155f1b3bb77.tar.gz
volse-hubzilla-8ad24ca3e8919060cf650f526ddce155f1b3bb77.tar.bz2
volse-hubzilla-8ad24ca3e8919060cf650f526ddce155f1b3bb77.zip
Catch errors in template rendering. Output a generic error and log problem.
-rw-r--r--include/text.php8
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;
}