aboutsummaryrefslogtreecommitdiffstats
path: root/include/template_processor.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-03-01 11:32:49 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2012-03-01 11:32:49 +0100
commitc462ed9fc50e2c2a60e8cb01314a7d5fa498b412 (patch)
tree3f562d1779876e1c5348ffcd1dfc222608a1706f /include/template_processor.php
parenta26ce7c56b91defccf0b222c9c9481d4b05f3c8d (diff)
downloadvolse-hubzilla-c462ed9fc50e2c2a60e8cb01314a7d5fa498b412.tar.gz
volse-hubzilla-c462ed9fc50e2c2a60e8cb01314a7d5fa498b412.tar.bz2
volse-hubzilla-c462ed9fc50e2c2a60e8cb01314a7d5fa498b412.zip
template proc: avoid a notice and allow template name to include to be passed with a variable value
Diffstat (limited to 'include/template_processor.php')
-rwxr-xr-xinclude/template_processor.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/template_processor.php b/include/template_processor.php
index 28c3f07dd..b4d444e1c 100755
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -116,7 +116,15 @@
* {{ inc <templatefile> [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)) {