From d73c036e5a1e99e11148627a550d920adbc22a6b Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 19 Jul 2018 20:31:47 +0200 Subject: [PATCH] check for set variables --- daux/d3processor.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/daux/d3processor.php b/daux/d3processor.php index 51b823f..445ac28 100644 --- a/daux/d3processor.php +++ b/daux/d3processor.php @@ -125,11 +125,14 @@ class d3DocumentRenderer implements BlockRendererInterface $daux = new Daux(Daux::STATIC_MODE, $output); $daux->initializeConfiguration(); - $variables = $daux->getParams()['variables']; - if (isset($variables) && is_array($variables) && count($variables)) { - foreach ($variables as $varname => $varvalue) { - $pattern = '/{\$'.$varname.'}/mU'; - $wholeDoc = preg_replace($pattern, $varvalue, $wholeDoc); + $params = $daux->getParams(); + if (isset($params['variables'])) { + $variables = $params['variables']; + if (isset($variables) && is_array($variables) && count($variables)) { + foreach ($variables as $varname => $varvalue) { + $pattern = '/{\$'.$varname.'}/mU'; + $wholeDoc = preg_replace($pattern, $varvalue, $wholeDoc); + } } }