cvs: smarty / NEWS /libs/plugins function.math.php

From: Date: Sat, 19 Apr 2003 10:32:05 +0000
Subject: cvs: smarty / NEWS /libs/plugins function.math.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-536@lists.php.net to get a copy of this message
messju Sat Apr 19 06:32:05 2003 EDT Modified files: /smarty NEWS /smarty/libs/plugins function.math.php Log: enabled hex-constants in function.math.php Index: smarty/NEWS diff -u smarty/NEWS:1.343 smarty/NEWS:1.344 --- smarty/NEWS:1.343 Sat Apr 19 06:12:18 2003 +++ smarty/NEWS Sat Apr 19 06:32:05 2003 @@ -1,3 +1,4 @@ + - enabled hex-constants in function.math.php (messju) - enabled hex-constants (0x...) as function-attributes, inside if-statements and as modifier-parameters (messju) - fixed bug with passing $smarty as reference in Smarty.compiler.class Index: smarty/libs/plugins/function.math.php diff -u smarty/libs/plugins/function.math.php:1.5 smarty/libs/plugins/function.math.php:1.6 --- smarty/libs/plugins/function.math.php:1.5 Sun Apr 6 08:24:46 2003 +++ smarty/libs/plugins/function.math.php Sat Apr 19 06:32:05 2003 @@ -25,11 +25,10 @@ } // match all vars in equation, make sure all are passed - preg_match_all("![a-zA-Z][a-zA-Z0-9_]*!",$equation, $match); + preg_match_all("!\!(0x)([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[0] as $curr_var) { + foreach($match[2] 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"); return;

« previous php.smarty.cvs (#536) next »