summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2012-06-27 21:03:43 +0200
committerKevin Chabowski <kevin@kch42.de>2012-06-27 21:03:43 +0200
commit06eea058aac1b3edbd526474ce71bfe47194fb46 (patch)
tree6dcf0e7d3e919ac38b3ccfd31ab1d2c70dc81c07
parent7042a32d61399b8a30d27d293122c67212e0cb10 (diff)
downloadste-06eea058aac1b3edbd526474ce71bfe47194fb46.tar.gz
ste-06eea058aac1b3edbd526474ce71bfe47194fb46.tar.bz2
ste-06eea058aac1b3edbd526474ce71bfe47194fb46.zip
Fixed STECore::get_var_reference bugs.
* It did not return a reference. * Some Tags from the standardlib used references in a wrong way.
-rw-r--r--stupid_template_engine.php8
1 files 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 <ste:arraylen>.");
- $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 <ste:inc>.");
- $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 <ste:dec>.");
- $ref = $ste->_get_var_reference($ste->vars, $params["var"]);
+ $ref = &$ste->get_var_reference($params["var"], True);
$ref--;
}