From 2272e4d819b3d4970df58a7c9a01e6d7fe815c6e Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 12 Sep 2022 12:09:41 +0200 Subject: [PATCH] Add change in regex for PRCE (PHP < 7.3) --- libs/plugins/function.math.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/plugins/function.math.php b/libs/plugins/function.math.php index c02c8b48..f9cf67fe 100644 --- a/libs/plugins/function.math.php +++ b/libs/plugins/function.math.php @@ -70,7 +70,7 @@ function smarty_function_math($params, $template) $number = '(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; $operators = '[,+\/*\^%-]'; // Allowed math operators - $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)*\)|\((?1)+\)))(?:'.$operators.'(?1))?)+$/'; + $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)*\)|\((?1)*\)))(?:'.$operators.'(?1))?)+$/'; if (!preg_match($regexp, $equation)) { trigger_error("math: illegal characters", E_USER_WARNING);