mirror of
https://github.com/smarty-php/smarty.git
synced 2025-12-03 15:59:32 +01:00
code cleanup and optimizations 3.1.32-dev-34
This commit is contained in:
@@ -38,7 +38,7 @@ function smarty_function_math($params, $template)
|
||||
$equation = $params[ 'equation' ];
|
||||
|
||||
// make sure parenthesis are balanced
|
||||
if (substr_count($equation, "(") != substr_count($equation, ")")) {
|
||||
if (substr_count($equation, '(') !== substr_count($equation, ')')) {
|
||||
trigger_error("math: unbalanced parenthesis", E_USER_WARNING);
|
||||
|
||||
return;
|
||||
@@ -59,9 +59,9 @@ function smarty_function_math($params, $template)
|
||||
}
|
||||
|
||||
foreach ($params as $key => $val) {
|
||||
if ($key != "equation" && $key != "format" && $key != "assign") {
|
||||
if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {
|
||||
// make sure value is not empty
|
||||
if (strlen($val) == 0) {
|
||||
if (strlen($val) === 0) {
|
||||
trigger_error("math: parameter '{$key}' is empty", E_USER_WARNING);
|
||||
|
||||
return;
|
||||
@@ -86,7 +86,7 @@ function smarty_function_math($params, $template)
|
||||
}
|
||||
|
||||
foreach ($params as $key => $val) {
|
||||
if ($key != "equation" && $key != "format" && $key != "assign") {
|
||||
if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {
|
||||
$equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user