aboutsummaryrefslogtreecommitdiffstats
path: root/include/template_processor.php
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-02-27 00:03:51 +0100
committerMichael <icarus@dabo.de>2012-02-27 00:03:51 +0100
commit18679111f5aed8f1c5e7ccb9857195e52c57765d (patch)
treebffb4a563ed2fe1ff02a4221e28c608460c866db /include/template_processor.php
parentfe3dfbee5638dd2988bd8b126652b3138572f02c (diff)
parent6ddd444afde33337235eab3aa9d6d1fe12bcb7a4 (diff)
downloadvolse-hubzilla-18679111f5aed8f1c5e7ccb9857195e52c57765d.tar.gz
volse-hubzilla-18679111f5aed8f1c5e7ccb9857195e52c57765d.tar.bz2
volse-hubzilla-18679111f5aed8f1c5e7ccb9857195e52c57765d.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/template_processor.php')
-rwxr-xr-xinclude/template_processor.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/template_processor.php b/include/template_processor.php
index 0d476f0e6..7f270fb4b 100755
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -32,11 +32,12 @@
if(is_array($r) && count($r)) {
foreach ($r as $k => $v ) {
- if (is_array($v))
+ if (is_array($v)) {
$this->_build_replace($v, "$prefix$k.");
-
- $this->search[] = $prefix . $k;
- $this->replace[] = $v;
+ } else {
+ $this->search[] = $prefix . $k;
+ $this->replace[] = $v;
+ }
}
}
}
@@ -53,7 +54,7 @@
$keys = array_map('trim',explode(".",$name));
$val = $this->r;
foreach($keys as $k) {
- $val = $val[$k];
+ $val = (isset($val[$k]) ? $val[$k] : null);
}
return $val;
}
@@ -79,8 +80,8 @@
} else {
$val = $this->_get_var($args[2]);
}
- list($strue, $sfalse)= preg_split("|{{ *else *}}|", $args[3]);
- return ($val?$strue:$sfalse);
+ $x = preg_split("|{{ *else *}}|", $args[3]);
+ return ( $val ? $x[0] : (isset($x[1]) ? $x[1] : ""));
}
/**