From 632e85745f0fbc1ea40f3a89589704b27f5c31d4 Mon Sep 17 00:00:00 2001 From: SecretR Date: Wed, 9 Jul 2014 16:32:17 +0300 Subject: [PATCH] Simple parser supports arrays in a proper way --- e107_handlers/e_parse_class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index a8345af3d..532a65207 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -791,11 +791,11 @@ class e_parse extends e_parser * Simple parser * * @param string $template - * @param e_vars $vars + * @param e_vars|array $vars * @param string $replaceUnset string to be used if replace variable is not set, false - don't replace * @return string parsed content */ - function simpleParse($template, e_vars $vars, $replaceUnset='') + function simpleParse($template, $vars, $replaceUnset='') { $this->replaceVars = $vars; $this->replaceUnset = $replaceUnset; @@ -808,8 +808,9 @@ class e_parse extends e_parser $key = $tmp[1]; if(is_array($this->replaceVars)) { - return ($this->replaceVars[$key] !== null ? $this->replaceVars[$key]: $unset); - } + $this->replaceVars = new e_vars($this->replaceVars); + //return ($this->replaceVars[$key] !== null ? $this->replaceVars[$key]: $unset); + } // return ($this->replaceVars->$tmp[1] !== null ? $this->replaceVars->$tmp[1] : $unset); // Doesn't work. }