From 06eea058aac1b3edbd526474ce71bfe47194fb46 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 27 Jun 2012 21:03:43 +0200 Subject: Fixed STECore::get_var_reference bugs. * It did not return a reference. * Some Tags from the standardlib used references in a wrong way. --- stupid_template_engine.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stupid_template_engine.php b/stupid_template_engine.php index 8e5beb5..6acb6d7 100644 --- a/stupid_template_engine.php +++ b/stupid_template_engine.php @@ -1176,7 +1176,7 @@ class STECore public function &get_var_reference($name, $create_if_not_exist) { - $ref = $this->_get_var_reference($this->vars, $name, $create_if_not_exist); + $ref = &$this->_get_var_reference($this->vars, $name, $create_if_not_exist); return $ref; } @@ -1372,7 +1372,7 @@ class STEStandardLibrary { if(empty($params["array"])) throw new RuntimeError("Missing array parameter in ."); - $a = $ste->get_var_by_name($params["array"]); + $a = $ste->get_var_by_name($params["array"], False); return (is_array($a)) ? count($a) : ""; } @@ -1380,7 +1380,7 @@ class STEStandardLibrary { if(empty($params["var"])) throw new RuntimeError("Missing var parameter in ."); - $ref = $ste->_get_var_reference($ste->vars, $params["var"]); + $ref = &$ste->get_var_reference($params["var"], True); $ref++; } @@ -1388,7 +1388,7 @@ class STEStandardLibrary { if(empty($params["var"])) throw new RuntimeError("Missing var parameter in ."); - $ref = $ste->_get_var_reference($ste->vars, $params["var"]); + $ref = &$ste->get_var_reference($params["var"], True); $ref--; } -- cgit v1.2.3-70-g09d2