From: Fabio Comuni Date: Thu, 1 Mar 2012 10:32:49 +0000 (+0100) Subject: template proc: avoid a notice and allow template name to include to be passed with... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c462ed9fc50e2c2a60e8cb01314a7d5fa498b412;p=friendica.git template proc: avoid a notice and allow template name to include to be passed with a variable value --- diff --git a/include/template_processor.php b/include/template_processor.php index 28c3f07ddd..b4d444e1c6 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -116,7 +116,15 @@ * {{ inc [with $var1=$var2] }}{{ endinc }} */ private function _replcb_inc($args){ - list($tplfile, $newctx) = array_map('trim', explode("with",$args[2])); + if (strpos($args[2],"with")) { + list($tplfile, $newctx) = array_map('trim', explode("with",$args[2])); + } else { + $tplfile = trim($args[2]); + $newctx = null; + } + + if ($tplfile[0]=="$") $tplfile = $this->_get_var($tplfile); + $this->_push_stack(); $r = $this->r; if (!is_null($newctx)) {