- security fix in {math} plugin

This commit is contained in:
Uwe.Tews
2010-04-17 10:24:44 +00:00
parent 09c208eda6
commit d44ffe9132

View File

@@ -39,7 +39,7 @@ function smarty_function_math($params, $smarty, $template)
}
// match all vars in equation, make sure all are passed
preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match);
$allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
@@ -81,4 +81,4 @@ function smarty_function_math($params, $smarty, $template)
}
}
}
?>
?>