From 7b2536e0bef980a9d153522320c14dc5261b4ba4 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 2 May 2018 14:39:52 +0200 Subject: [PATCH] page: replace missing placeholders by warning --- page.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/page.php b/page.php index c6eee87..290a596 100644 --- a/page.php +++ b/page.php @@ -26,7 +26,12 @@ function getoutput($blocks = []) '< \[\[ ([^]]*) \]\] >x', function ($sub) use ($blocks) { list ($placeholder, $name) = $sub; - $html = $blocks[$name]; + if (isset($blocks[$name])) { + $html = $blocks[$name]; + } + else { + $html = ''.$name.' ontbreekt'; + } return sprintf('%s', is_numeric($name) ? '' : $placeholder, # edit replacement preg_replace('{}', '', $html) # contents -- 2.30.0