diff --git a/change_log.txt b/change_log.txt index a52159fe..23e98e01 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ ===== trunk ===== 04.10.2011 - bugfix assign() in plugins called in subtemplates did change value also in parent template +- bugfix of problem introduced with r4342 on math plugin ===== Smarty-3.1.2 ===== 03.10.2011 diff --git a/libs/plugins/function.math.php b/libs/plugins/function.math.php index 60a92f40..f4d3f05e 100644 --- a/libs/plugins/function.math.php +++ b/libs/plugins/function.math.php @@ -24,8 +24,8 @@ function smarty_function_math($params, $template) { static $_allowed_funcs = array( - 'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true, - 'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, + 'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true, + 'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, 'rand' => true, 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true ,'tan' => true ); // be sure equation parameter is present @@ -55,7 +55,7 @@ function smarty_function_math($params, $template) foreach($params as $key => $val) { if ($key != "equation" && $key != "format" && $key != "assign") { // make sure value is not empty - if (isset($val[0])) { + if (strlen($val)==0) { trigger_error("math: parameter $key is empty",E_USER_WARNING); return; }