diff --git a/NEWS b/NEWS
index e43295c1..7b7cf973 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
Version 2.0
-----------
- - added "eval" plugin for evaluating variables as templates (Monte)
+ - added "eval" function plugin for evaluating variables as templates.
+ (Monte)
- removed $tpl_file_ext class variable, no longer used. (Monte)
- added "hex" and "hexentity" escape types to escape modifier. (Monte)
- removed dependency on PEAR. (Andrei)
diff --git a/docs/designers.sgml b/docs/designers.sgml
index ad7c0ac6..2b128570 100644
--- a/docs/designers.sgml
+++ b/docs/designers.sgml
@@ -2712,13 +2712,6 @@ The value of $name is Bob.
counter function will be assigned to this template variable instead of
being output to the template. (new in Smarty 1.5.0)
-
-
- evaluated variables follow the same rules as templates, so for
- instance PHP tags are escaped by default, or if you have
- security enabled then embedding PHP is not allowed.
-
-
counter
@@ -2764,6 +2757,14 @@ OUTPUT:
n/a
variable (or string) to evaluate
+
+ assign
+ string
+ No
+ n/a
+ the template variable the output will be assigned
+ to
+
diff --git a/libs/plugins/function.eval.php b/libs/plugins/function.eval.php
index e13e065d..bce9dc7f 100644
--- a/libs/plugins/function.eval.php
+++ b/libs/plugins/function.eval.php
@@ -17,15 +17,15 @@ function smarty_function_eval($params, &$this)
return;
}
- $this->_compile_template("eval_var",$var,$source);
+ $this->_compile_template("evaluated template", $var, $source);
if (!empty($assign)) {
ob_start();
- eval('?>'.$source);
- $this->assign($assign,ob_get_contents());
+ eval('?>' . $source);
+ $this->assign($assign, ob_get_contents());
ob_end_clean();
} else {
- eval('?>'.$source);
+ eval('?>' . $source);
}
}
diff --git a/plugins/function.eval.php b/plugins/function.eval.php
index e13e065d..bce9dc7f 100644
--- a/plugins/function.eval.php
+++ b/plugins/function.eval.php
@@ -17,15 +17,15 @@ function smarty_function_eval($params, &$this)
return;
}
- $this->_compile_template("eval_var",$var,$source);
+ $this->_compile_template("evaluated template", $var, $source);
if (!empty($assign)) {
ob_start();
- eval('?>'.$source);
- $this->assign($assign,ob_get_contents());
+ eval('?>' . $source);
+ $this->assign($assign, ob_get_contents());
ob_end_clean();
} else {
- eval('?>'.$source);
+ eval('?>' . $source);
}
}