From 8a24a176d21d47d6f33e5f6b20b5ee1b32e5f5bc Mon Sep 17 00:00:00 2001 From: andrey Date: Wed, 27 Feb 2002 22:35:34 +0000 Subject: [PATCH] *** empty log message *** --- NEWS | 3 ++- docs/designers.sgml | 15 ++++++++------- libs/plugins/function.eval.php | 8 ++++---- plugins/function.eval.php | 8 ++++---- 4 files changed, 18 insertions(+), 16 deletions(-) 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); } }