From 44e76b4a3b857b65c7423bc05ab393568091b2e3 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Thu, 17 Sep 2015 12:33:32 +1000 Subject: [PATCH] Enable underscores and numbers in equation --- includes/libraries/class-eqeos.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/libraries/class-eqeos.php b/includes/libraries/class-eqeos.php index 9c3c6260..7c004ce0 100644 --- a/includes/libraries/class-eqeos.php +++ b/includes/libraries/class-eqeos.php @@ -21,6 +21,8 @@ * developer. It is a safe way to evaluate expressions without putting * the system at risk. * + * Modified as per https://github.com/jlawrence11/eos/issues/2 + * * 2013/04 UPDATE: * - Moved to native class functions for PHP5 * - Removed deprecated `eregi` calls to `preg_match` @@ -350,7 +352,7 @@ class eqEOS { preg_replace("/\s/", "", $infix); //Find all the variables that were passed and replaces them - while((preg_match('/(.){0,1}[&$]([a-zA-Z_]+)(.){0,1}/', $infix, $match)) != 0) { + while((preg_match('/(.){0,1}[&$]([a-zA-Z0-9_]+)(.){0,1}/', $infix, $match)) != 0) { //remove notices by defining if undefined. if(!isset($match[3])) {