From c23569b7ca74b5fb547a4074fe991ec208664b48 Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 3 Jun 2002 16:13:37 +0000 Subject: [PATCH] fixed bug with call $assign --- libs/plugins/function.math.php | 16 ++++++++-------- plugins/function.math.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libs/plugins/function.math.php b/libs/plugins/function.math.php index 2beef46d..3926e379 100644 --- a/libs/plugins/function.math.php +++ b/libs/plugins/function.math.php @@ -11,12 +11,12 @@ function smarty_function_math($params, &$smarty) { // be sure equation parameter is present - if (empty($params["equation"])) { + if (empty($params['equation'])) { $smarty->trigger_error("math: missing equation parameter"); return; } - $equation = $params["equation"]; + $equation = $params['equation']; // make sure parenthesis are balanced if (substr_count($equation,"(") != substr_count($equation,")")) { @@ -53,17 +53,17 @@ function smarty_function_math($params, &$smarty) eval("\$smarty_math_result = ".$equation.";"); - if (empty($params["format"])) { - if (empty($params["assign"])) { + if (empty($params['format'])) { + if (empty($params['assign'])) { echo $smarty_math_result; } else { - $smarty->assign($params["assign"],$smarty_math_result); + $smarty->assign($params['assign'],$smarty_math_result); } } else { - if (empty($params["assign"])){ - printf($params["format"],$smarty_math_result); + if (empty($params['assign'])){ + printf($params['format'],$smarty_math_result); } else { - $smarty->assign($assign,sprintf($params["format"],$smarty_math_result)); + $smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result)); } } } diff --git a/plugins/function.math.php b/plugins/function.math.php index 2beef46d..3926e379 100644 --- a/plugins/function.math.php +++ b/plugins/function.math.php @@ -11,12 +11,12 @@ function smarty_function_math($params, &$smarty) { // be sure equation parameter is present - if (empty($params["equation"])) { + if (empty($params['equation'])) { $smarty->trigger_error("math: missing equation parameter"); return; } - $equation = $params["equation"]; + $equation = $params['equation']; // make sure parenthesis are balanced if (substr_count($equation,"(") != substr_count($equation,")")) { @@ -53,17 +53,17 @@ function smarty_function_math($params, &$smarty) eval("\$smarty_math_result = ".$equation.";"); - if (empty($params["format"])) { - if (empty($params["assign"])) { + if (empty($params['format'])) { + if (empty($params['assign'])) { echo $smarty_math_result; } else { - $smarty->assign($params["assign"],$smarty_math_result); + $smarty->assign($params['assign'],$smarty_math_result); } } else { - if (empty($params["assign"])){ - printf($params["format"],$smarty_math_result); + if (empty($params['assign'])){ + printf($params['format'],$smarty_math_result); } else { - $smarty->assign($assign,sprintf($params["format"],$smarty_math_result)); + $smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result)); } } }