X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftemplate_processor.php;h=252375a0605270a934236d9cb9a2cc5c7b09ee6f;hb=4584670af446553b6b7f7870e7081620ebaf44ee;hp=6c1b16592d71065a0ffe593247a632b0ce4ddae2;hpb=9c2c4839968169a191084d6d2b0d629d82430e67;p=friendica.git diff --git a/include/template_processor.php b/include/template_processor.php index 6c1b16592d..252375a060 100644 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -53,9 +53,8 @@ class Template implements ITemplateEngine { private function _get_var($name, $retNoKey = false) { $keys = array_map('trim', explode(".", $name)); - if ($retNoKey && !array_key_exists($keys[0], $this->r)) { + if ($retNoKey && !array_key_exists($keys[0], $this->r)) return KEY_NOT_EXISTS; - } $val = $this->r; foreach ($keys as $k) { $val = (isset($val[$k]) ? $val[$k] : null); @@ -74,16 +73,14 @@ class Template implements ITemplateEngine { if (strpos($args[2], "==") > 0) { list($a, $b) = array_map("trim", explode("==", $args[2])); $a = $this->_get_var($a); - if ($b[0] == "$") { + if ($b[0] == "$") $b = $this->_get_var($b); - } $val = ($a == $b); - } elseif (strpos($args[2], "!=") > 0) { + } else if (strpos($args[2], "!=") > 0) { list($a, $b) = array_map("trim", explode("!=", $args[2])); $a = $this->_get_var($a); - if ($b[0] == "$") { + if ($b[0] == "$") $b = $this->_get_var($b); - } $val = ($a != $b); } else { $val = $this->_get_var($args[2]); @@ -141,9 +138,8 @@ class Template implements ITemplateEngine { $newctx = null; } - if ($tplfile[0] == "$") { + if ($tplfile[0] == "$") $tplfile = $this->_get_var($tplfile); - } $this->_push_stack(); $r = $this->r;