cvs: smarty /libs/plugins function.math.php
"Monte Ohrt" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmohrt1112202223@cvsserver> |
mohrt Wed Mar 30 12:03:43 2005 EDT
Modified files:
/smarty/libs/plugins function.math.php
Log:
fix function testing logic
http://cvs.php.net/diff.php/smarty/libs/plugins/function.math.php?r1=1.7&r2=1.8&ty=u
Index: smarty/libs/plugins/function.math.php
diff -u smarty/libs/plugins/function.math.php:1.7 smarty/libs/plugins/function.math.php:1.8
--- smarty/libs/plugins/function.math.php:1.7 Sun Apr 20 17:12:03 2003
+++ smarty/libs/plugins/function.math.php Wed Mar 30 12:03:43 2005
@@ -35,12 +35,13 @@
}
// match all vars in equation, make sure all are passed
- preg_match_all("!\!(0x)([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match);
+ preg_match_all("!([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');
- foreach($match[2] as $curr_var) {
+
+ foreach($match[1] as $curr_var) {
if (!in_array($curr_var,array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
- $smarty->trigger_error("math: parameter $curr_var not passed as argument");
+ $smarty->trigger_error("math: function call $curr_var not allowed");
return;
}
}
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php