From: Mischa POSLAWSKY Date: Mon, 9 Jul 2018 23:08:53 +0000 (+0200) Subject: page: catch exceptions in placeholder scripts X-Git-Tag: v3.5~11 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/bb1eabd001954b5f9eb58b61f850a0cea111f87a page: catch exceptions in placeholder scripts Inline error (similar to missing) instead of global breakage. --- diff --git a/page.php b/page.php index b160e45..33a1f44 100644 --- a/page.php +++ b/page.php @@ -42,8 +42,15 @@ function getoutput($blocks = []) $Args .= '/'.$param; } } - include "$name.php"; - $html = ob_get_clean(); + try { + include "$name.php"; + $html = ob_get_clean(); + } + catch (Exception $e) { + $html = sprintf('%s', + "fout in $name: {$e->getMessage()}" + ); + } } else { $html = ''.$name.' ontbreekt';