From 8ad24ca3e8919060cf650f526ddce155f1b3bb77 Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Fri, 14 Sep 2018 17:35:12 -0400 Subject: Catch errors in template rendering. Output a generic error and log problem. --- include/text.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') 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 = "

ERROR: there was an error creating the output.

"; + } return $output; } -- cgit v1.2.3