From 6efaec1e15352c188c951773b960df05ff489258 Mon Sep 17 00:00:00 2001 From: jamiepratt Date: Sat, 16 Apr 2011 18:10:18 +0700 Subject: [PATCH] NOBUG move function definition is_valid_var_or_func_name above 'HERE BE INTERNAL METHODS' line. --- lib/evalmath/evalmath.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/evalmath/evalmath.class.php b/lib/evalmath/evalmath.class.php index 6195079214f..3e4041b245c 100644 --- a/lib/evalmath/evalmath.class.php +++ b/lib/evalmath/evalmath.class.php @@ -176,6 +176,14 @@ class EvalMath { return $output; } + /** + * @param string $name + * @return boolean Is this a valid var or function name? + */ + public static function is_valid_var_or_func_name($name){ + return preg_match('/'.self::$namepat.'$/iA', $name); + } + //===================== HERE BE INTERNAL METHODS ====================\\ // Convert infix to postfix notation @@ -428,6 +436,7 @@ class EvalMath { if (!$this->suppress_errors) trigger_error($msg, E_USER_WARNING); return false; } + } // for internal use